// Quit if [ABANDON] was pressed if lastkey()=ctrl('g') quit endif
https://www.lianja.com/doc/index.php/QUIT
exit("User "+user()+ " exited at "+time())
https://www.lianja.com/doc/index.php/EXIT()
Terminate session returning a message or status code
die("User "+user()+ " exited at "+time())
https://www.lianja.com/doc/index.php/DIE()
compile *.prg
https://www.lianja.com/doc/index.php/COMPILE
private lRunning = .T. do while lRunning if not file("C:\temp\message.txt") ? time() sleep 5 loop endif fd = fopen("C:\temp\message.txt") cMessage = fgets(fd) ? cMessage if cMessage = "STOP" lRunning = .F. endif fclose(fd) erase C:\temp\message.txt enddo
https://www.lianja.com/doc/index.php/SLEEP
? exec("open database southwind","use example","browse")
https://www.lianja.com/doc/index.php/EXEC()
// Character field create table scripts (script char(200)) use scripts append blank replace script with "for i=1 to 10" + CHR(13) + "?i" + CHR(13) + "endfor" + CHR(13) execscript(script) // Text constant execscript("for i=1 to 10" + CHR(13) + "?i" + CHR(13) + "endfor" + CHR(13)) // Memory variable m_script = "for i=1 to 10" + CHR(13) + "?i" + CHR(13) + "endfor" + CHR(13) execscript(m_script) // Including parameters execscript("parameters p1,p2"+chr(13)+"messagebox(p1+etos(p2))"+chr(13),"Hello ",2013)
https://www.lianja.com/doc/index.php/EXECSCRIPT()
set compile on do myprog
https://www.lianja.com/doc/index.php/SET_COMPILE
set compile on set development on do prototype
https://www.lianja.com/doc/index.php/SET_DEVELOPMENT
clear events
https://www.lianja.com/doc/index.php/CLEAR_EVENTS
do form recipes
https://www.lianja.com/doc/index.php/DO_FORM
doevents
https://www.lianja.com/doc/index.php/DOEVENTS
? getpid() 14586 pid = getpid() ? type("pid") N
https://www.lianja.com/doc/index.php/GETPID()
run "C:\Program Files (x86)\Lianja\bin\lianjaruntime.exe"
https://www.lianja.com/doc/index.php/RUN
spawn db printrep pid = spawnpid() on escape killed = cancelpid(pid) if not activepid(pid) ? "Printing completed." endif
https://www.lianja.com/doc/index.php/SPAWN
spawn db program ? activepid(spawnpid()) .T.
https://www.lianja.com/doc/index.php/ACTIVEPID()
spawn db program m_activepid = spawnpid() if activepid(m->m_activepid) if cancelpid(m->m_activepid) dialog box "Process Canceled." else dialog box "Process couldn't be Canceled." endif else dialog box "There is no Process Active." endif
https://www.lianja.com/doc/index.php/CANCELPID()
spawn db program m_activepid = spawnpid() if activepid(m->m_activepid) if cancelpid(m->m_activepid) dialog box "Process Canceled " else dialog box "Unable to Cancel Process." endif else dialog box "There is no Process Active". endif
https://www.lianja.com/doc/index.php/SPAWNPID()
clear all
https://www.lianja.com/doc/index.php/CLEAR_ALL
//Check user details before proceeding public validuser #include "checklogin.ch" if not validuser return endif ...
https://www.lianja.com/doc/index.php/INCLUDE
if isserver() // running via server endif
https://www.lianja.com/doc/index.php/ISSERVER()
> ? dolevel() 0 //master.prg procedure subproc1 ? dolevel() ? return ? dolevel() subproc1() //end of master.prg > do master 1 2
https://www.lianja.com/doc/index.php/DOLEVEL()
> ? level() 0 //master.prg procedure subproc1 ? level() ? return ? level() subproc1() //end of master.prg > do master 1 2
https://www.lianja.com/doc/index.php/LEVEL()
use demo ? evaluate("customer.last_name") Siegel ? evaluate("1+1") 2 m_var = "DATE() > {01/01/2001}" ? evaluate(m_var) .T.
https://www.lianja.com/doc/index.php/EVALUATE()
When creating a desktop shortcut for running the Lianja App Builder or for runtime Lianja Apps there are several command line options that can be specified.
The following table provides details of the currently available command line options. These can be combined to customize the running of an App e.g.
lianja --app orderprocessing --maximized lianja myprogram.dbo lianjaruntime --kiosk --fullscreen --runtimecaption "Our company Apps" lianjarun --kiosk --fullscreen --runtimecaption "Our company Apps"
The full Target is:
C:\lianja\bin\lianjaruntime.exe C:\lianja\cloudserver\tenants\public\apps\myapp\start --nosplashscreen
Note: If you are running some custom program code that is going to take a long time to complete e.g. consolidating inventory, then you can provide feedback to the user via a system tray icon on the desktop e.g.
tray = createObject("SystemTrayIcon") tray.icon = "app:/myapp.png" tray.showMessage("Message", "Consolidating inventory...") // perform some long running operation to consolidate inventory tray.showMessage("Message", "Consolidation completed...")