OpenFBini

Preference ››
Parent Previous Next

OpenFBini

Синтаксис

Function OpenFBini(ByRef sFileName As String, ByVal flag As bool = 0) As handle

Описание

Функция открывает существующий файл настроек для чтения и записи. Если файл не существует, то возвращает -1

Параметры

sFileName - имя файла настроек

flag - флаг, может быть:
0 - позволяет открывать файл только для чтения
1 - открывает файл для чтения и записи

Платформы

Windows , Linux

Пример

#Include "window9.bi"
If CreateFBini("prefar.ini") <> Cast(Any Ptr, -1) Then
  Dim As String ss="hello"
  Dim As Integer32 ii=76
  WriteGroupFBini("Group1")
  WriteGroupFBini("Group2")
  WriteValueFBini("Group1","Key",ss)
  WriteValueFBini("Group2","Key",ii)
  CloseFBini()
EndIf
If OpenFBini("prefar.ini",1) <> Cast(Any Ptr, -1) Then
  ? ReadStringValueFBini("Group1","Key")
  ? ReadIntegerValueFBini("Group2","Key")
  ?
  dim as STRING sz = "Hello world"
  WriteValueFBini("Group1","Key",sz)
  WriteValueFBini("Group2","Key",Cast(Integer32,90))
  ? ReadStringValueFBini("Group1","Key")
  ? ReadIntegerValueFBini("Group2","Key")
  CloseFBini()
  Sleep()
EndIf

Результат

hello
76

Hello world
90

Created with the Personal Edition of HelpNDoc: Generate EPub eBooks with ease