Usina BRAdvPL Guide
Sign in
← All topics
CLASSUnder review

FWProfile

FWProfile():New()

Organizes preferences by user, program and task.

FWProfileAdvPL
01 · OVERVIEW

Overview

The developer defines profile structure. SetProgram, SetTask, SetType and SetUser define persistence context; SetTask keys are limited to ten characters. The example manipulates an in-memory array without Load, Save or Delete. Load/Save control company/branch scope; SetCompany and SetBranch require LIB 20240226 or newer. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWProfile():New()

Methods

SetProfileSets in-memory data.o:SetProfile(aProfile)
GetProfileReads application-defined structure.o:GetProfile() -> aProfile
Load / SaveLoads or persists in configured context.o:Load([lByEmpFil]) / o:Save([lByEmpFil])
DestroyReleases object and references.o:Destroy()
03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed448()
    Local oProf := FWProfile():New()
    Local aProf
    // Application-owned array, without persistence.
    oProf:SetProfile({"ED01",20})
    aProf := oProf:GetProfile()
    ConOut(cValToChar(aProf[2]))
    oProf:Destroy()
Return Nil
Expected result

Reads the configured second element: 20. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Version array structure and validate loaded content before indexing. Do not store passwords in profiles.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWProfile. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha