PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 25 → Wx - Trabalhando com arquivos .ini (Arquivos de Configuração)
Wx - Trabalhando com arquivos .ini (Arquivos de Configuração)
Started by adrianoboller, Oct., 27 2015 5:07 PM - 1 reply
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on October, 27 2015 - 5:07 PM
Prezados,

Segue um exemplo de como trabalhar com arquivo de configuração do tipo ini.

Procedure Arquivo_INI()

PathFile is string = fCurrentDir(fCurrentDrive()) +"\Sistema.ini"

IF fFileExist(PathFile) = True

IF EDT_Servidor = ""
EDT_Servidor = INIRead("Sistema", "Server", "", PathFile)
IF ErrorOccurred = True AND EDT_Servidor = "" THEN
Error()
END
END

IF EDT_Usuario = ""
EDT_Usuario = INIRead("Sistema", "User", "", PathFile)

IF ErrorOccurred = True AND EDT_Usuario = "" THEN
Error()
ELSE
Usuario = EDT_Usuario
END
END

IF EDT_Base_Dados = ""
EDT_Base_Dados = INIRead("Sistema", "BD", "", PathFile)
IF ErrorOccurred = True AND EDT_Base_Dados = "" THEN
Error()
END
END

ELSE
INIWrite("Sistema","Server",EDT_Servidor,PathFile)
INIWrite("Sistema","User",EDT_Usuario,PathFile)
INIWrite("Sistema","BD",EDT_Base_Dados,PathFile)
END


--
Adriano Jose Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
______________________________________________
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on October, 27 2015 - 5:10 PM
Links:

http://help.windev.com/en-US/…

http://help.windev.com/en-US/…

--
Adriano Jose Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
______________________________________________