Author Topic: NaaLaa reserved words / built in variable?  (Read 526 times)

lost_mind

  • Newbie
  • *
  • Posts: 8
    • View Profile
NaaLaa reserved words / built in variable?
« on: September 10, 2016 »
Hello,

Naalaa is great stuff, kudos to the creators and demonstrators!

I would like to know if i can find somewhere a list of all the reserved words for Naalaa?
some of them are used in example, but can't find them in the documentation.
Like screenh, screenw for example.

Thanks for reading
see you

B+

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: NaaLaa reserved words / built in variable?
« Reply #1 on: September 11, 2016 »
It's funny, I don't think to do this for myself but when someone else asks...

naalaa_reserved_index.txt
Code: [Select]
AND
OR
SHL
SHR
abs
acos
active
additive
and
asc
asin
atan
atan2
break
caret
cels
center
chdir

chr
clear
clip
cls
color
colori
colorkey
cols
constant
cos
create
datafolder
date
debug
decimal
degrees
disable
do
download
downto
draw
else
elseif
enable
end
endfunc
endif
endproc
eof
exists
false
fheight
file
float
font
for
free
function
fwidth
grid
height
hidden
hraster
hscroll
if
image
import
include
inkey
instr
int
joybutton
joyx
joyy
justification
keydown
left
len
line
load
loop
lower
max
mid
min
mouse
mousebutton
mousex
mousey
music
next
not
off
on
open
openfile
or
pixel
pixeli
play
poly
polyf
pop
primary
proc
procedure
projection
push
radians
randomize
read
read16
read32
read8
readf
reads
rect
redraw
rem
return
right
rln
rnd
rotate
rows
run
save
savefile
scale
screenh
screenw
scroll
set
shellexecute
sin
sizeof
sound
sqr
stop
str
system
tan
td_cam
td_fog
td_frustrum
td_quad
then
time
to
transformation
translate
true
until
upper
visible
volume
vraster
vscroll
wait
wend
while
width
window
wln
write
write16
write32
write8
writef
writes
zone
zoneh
zonew
zonex
zoney

File created from this:
Code: [Select]
' quick load and sort.bas for SmallBASIC 0.12.6 [B+=MGA] 2016-09-10
tload "naalaa_reserved.txt", fstr, 1
split fstr, " ", reserved
sort reserved
open "naalaa_reserved_index.txt" for output as #1
for i = lbound(reserved) to ubound(reserved)
  print #1, reserved(i) + chr(13)
next
close #1
? "File ready!"
pause

note: naalaa_reserved.txt is in the Naalaa folder, I think NED6 uses it to highlight reserved words.
« Last Edit: September 11, 2016 by B+ »
B+

lost_mind

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: NaaLaa reserved words / built in variable?
« Reply #2 on: September 11, 2016 »
Oh thanks!

I have changed the color setting of the editor in config file, and didn't even see the files!
Sorry to bother.
Must have searched to late in the night.

see you

B+

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: NaaLaa reserved words / built in variable?
« Reply #3 on: September 11, 2016 »
Oh, I can change colors!  :)
B+

lost_mind

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: NaaLaa reserved words / built in variable?
« Reply #4 on: September 11, 2016 »
Oh i did that with my config files to change color:
Code: [Select]
@font       Consolas, 20
@reserved   0 200 0
@rem        100 0 0
@string     0 0 200
@other      0 0 0
@background 100 100 100
@inactive   10
I didn't understand what @inactive stand for, can you say me?
Thanks and see you

B+

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: NaaLaa reserved words / built in variable?
« Reply #5 on: September 11, 2016 »
Hmm...

Could change it and see what happens... (yuck!)

Could search NED6.txt for "inactive" and see what you find... (better?)
Quote
rem ==================================================================
rem Load config.
rem ==================================================================
procedure LoadConfig()
   vEditFont = "Courier New, 10"
   vBGColor = "255 255 255"
   vReservedColor = "0 0 200"
   vRemColor = "128 128 128"
   vStringColor = "128 0 0"
   vOtherColor = "0 0 0"
   vInactiveTime = 5000
   open file 0, "config.txt"
   if file(0)
      while not eof(0)
         cfg$ = read$(0)
         if left$(cfg, 5) = "@font"
            vEditFont = RemoveWhite(cfg - "@font")
         elseif left$(cfg, 11) = "@background"
            vBGColor = RemoveWhite(cfg - "@background")
         elseif left$(cfg, 9) = "@reserved"
            vReservedColor = RemoveWhite(cfg - "@reserved")
         elseif left$(cfg, 4) = "@rem"
            vRemColor = RemoveWhite(cfg - "@rem")
         elseif left$(cfg, 7) = "@string"
            vStringColor = RemoveWhite(cfg - "@string")
         elseif left$(cfg, 6) = "@other"
            vOtherColor = RemoveWhite(cfg - "@other")
'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
         elseif left$(cfg, 9) = "@inactive"   
            vInactiveTime = 1000*int(RemoveWhite(cfg - "@inactive"))
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         endif
      wend
      free file 0
   else
   endif
endproc

What is vInactiveTime ?

Append: Well it looks like the code using it has been REM 'd out:
Quote
rem Main loop, where we fetch events from IUP and react on them.
do
   rem Refresh subroutines 5 seconds after last modif.
   eci = IupGetInt(editTabs, "VALUEPOS")
   rem if vInactiveTime
   rem   if editCtrl[eci].ch and time() > editCtrl[eci].ct + vInactiveTime
   rem      editCtrl[eci].ch = false
   rem      proc RecordSubs true
   rem   endif
   rem endif

« Last Edit: September 11, 2016 by B+ »
B+

Marcus

  • Administrator
  • Hero Member
  • *****
  • Posts: 549
    • View Profile
Re: NaaLaa reserved words / built in variable?
« Reply #6 on: September 11, 2016 »
In the old version, if the user was inactive for some time, the editor would scan for subroutines and update the dropdown list. This caused many problems with the cursor sometimes jumping to the top of the document. Now it's not used, I just update the subroutine list when the program is loaded and saved.
.\\\opz