NaaLaa
syntax help / example - Printable Version

+- NaaLaa (https://www.naalaa.com/forum)
+-- Forum: NaaLaa (https://www.naalaa.com/forum/forum-1.html)
+--- Forum: NaaLaa 7 Code (https://www.naalaa.com/forum/forum-4.html)
+--- Thread: syntax help / example (/thread-200.html)



syntax help / example - 1micha.elok - 02-26-2025

           
click the image to zoom in

Code:
'====================================================================
'HELPME.N7
'- An attempt to make a simple syntax help/example
'- Run on windows system
'- Console mode only
'
'INSTRUCTIONS
'- Place this file in the same folder as NED.EXE
'- Compile and Run helpme.n7
'- Examples
'  Help me : abs[ENTER]        to see the example of absolute value
'  Help me : ex3_loops[ENTER]  to see the example of using loops
'  Help me : dir help[ENTER]   to see functions/commands in examples\help
'  Help me : dir basic[ENTER]  to see functions/commands in examples\basic
'  Help me : exit[ENTER]       to exit this HELPME.N7
'====================================================================

include "file.n7"

path = []

'Main Loop
do
    write "Help me : ";temp=rln()
    if lower(temp) = "exit" then end
    if lower(temp) = "dir help" then system "dir examples\help\*.n7 /w"
    if lower(temp) = "dir basic" then system "dir examples\basic\*.n7 /w"
   
    path[1] = "examples/help/"+temp+".n7"
    path[2] = "examples/basic/"+temp+".n7"
   
    if ReadAllText(path[1])=unset and ReadAllText(path[2])=unset and
        temp<>"dir help" and temp<>"dir basic" then
        pln "Not found"
    elseif temp <> "dir"
        pln
        if ReadAllText(path[1])<>unset then
            pln ReadAllText(path[1])
        else
            pln ReadAllText(path[2])
        endif
    endif
   
    pln "--------------------------------------"
    system "pause"
    system "cls"
loop



RE: syntax help / example - johnno56 - 02-28-2025

"Run on Windows system"... As you know, I run with Linux Mint, but I run N7 with WINE... even so, your program ran like a charm... I can view the "help" example(s) using the console for reference while working within the IDE...

Very nicely done!


RE: syntax help / example - 1micha.elok - 03-03-2025

(02-28-2025, 10:36 AM)johnno56 Wrote: "Run on Windows system"... As you know, I run with Linux Mint, but I run N7 with WINE... even so, your program ran like a charm... I can view the "help" example(s) using the console for reference while working within the IDE...

Very nicely done!

You'll find a built-in syntax help/example in NED too [ Thanx to Marcus ]

   
click the image to zoom in
1. Click on a keyword, then press F1

   
click the image to zoom in
2. Press FI again to see the syntax help/example


RE: syntax help / example - johnno56 - 03-03-2025

Whenever I tinker with code, I am a bit - ok a lot ... lol - old-school and enjoy the use of a "hard copy" reference to the left of my keyboard... But, whether it is your "helpme" file of N7's "F1" or a "manual", it all achieves the same purpose... support and education.... but I must say that both you and Marcus are making my experiences a lot easier.... Cool...