BBx-Kitchen / bbj-language-server

BBj Language Server
MIT License
6 stars 6 forks source link

Adding verb FILE/XFILE: questions #152

Open Lotes opened 3 weeks ago

Lotes commented 3 weeks ago

@StephanWald

I would like to add the verb FILE/XFILE, but I miss some information.

Look at the Documentation:

It says we have a string1 and a string2. Plus an ERR for the error handling. But it also gives a hint that we have a MODE with some options (which position does it have, it seems to be optional? does it require own parentheses or such stuff?). This can be an opportunity to improve the docs. AND there is a special syntax I do not know yet in the code examples:

FILE F$,G$(86)

Is G$(86) a special syntax for an expression or do the parentheses belong to the current verb?

StephanWald commented 1 week ago

Partly answer: G$(86) means the string G$ starting at position 86, the parentheses are for substring handling. See https://documentation.basis.cloud/BASISHelp/WebHelp/usr/Language_Concepts/substrings.htm

StephanWald commented 1 week ago

We should explicitly add MODE="xxx" to the syntax for those verbs; it goes at the end, along with ERR=:

 file fid$
 file fid$,fin$(86)
 file fid$,fin$(86),mode="options"
 file fid$,fin$(86),err=*next
 file fid$,fin$(86),mode="options",err=*next
open (1)"states.dat"
fid$=fid(1),fin$=fin(1)
close(1)
erase "states.dat"
file fid$,fin$(86),mode=""
open(1)"states.dat"
call"_fids"

FIN$(86) and XFIN$(86) refers to the substring of the FIN and XFIN strings that contains the key definition. Syntactically they're just strings.