You are not logged in.

gablea

Beginner

  • "gablea" is male
  • "gablea" started this thread

Posts: 3

Date of registration: Oct 15th 2014

Location: Northampton, England

Occupation: Retail Hardware & Software engineer

  • Send private message

1

Friday, October 24th 2014, 12:07pm

Help Please con converting some code

Hi everyoine,

I am trying to convert this code from VB6 to Jabaco

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
Option Explicit
Public Function ReadIniValue(INIpath As String, KEY As String, Variable As String) As StringDim NF              As IntegerDim Temp            As StringDim LcaseTemp       As StringDim ReadyToRead     As Boolean    AssignVariables:        NF = FreeFile        ReadIniValue = ""        KEY = "[" & LCase$(KEY) & "]"        Variable = LCase$(Variable)    EnsureFileExists:    Open INIpath, Binary, ReadAndWrite, LockReadAndWrite, NF    Close NF    SetAttr INIpath, vbArchive    LoadFile:   Open INIpath, Input, ReadAndWrite, LockReadAndWrite, NF    While Not EOF(NF)
    ReadLine NF
    LcaseTemp = LCase$(Temp)
    If InStr(LcaseTemp, "[") <> 0 Then ReadyToRead = False
    If LcaseTemp = KEY Then ReadyToRead = True
    If InStr(LcaseTemp, "[") = 0 And ReadyToRead = True Then        If InStr(LcaseTemp, Variable & "=") = 1 Then            ReadIniValue = Mid$(Temp, 1 + Len(Variable & "="))
           Close NF: Exit Function
            End If
        End If
   Wend
    Close NF
End Function



BUt is is not work :( can someone advise me as it keeps erroring out and saying this like

ReadLine is not correct

Rate this thread
WoltLab Burning Board