Debug

Q:
This works fine in my application.

Code:
for i in range(1,20):
  Lianja.console(str(i))

But it looks like the it is not picking up both lines when I try to test it in the app inspector or console.
A:
You can only issue single-line commands in the Console/App Inspector Command Windows.


Q:

Code:
columnName = columnDef.name
sql = 'alter table ? add column ? ? '                                                           
                                                        
prepare stmt from :sql
execute stmt using :tableName, :columnName, :colDefSql

 

**** Lianja error ****
execute stmt using :tableName, :columnName, :colDefSql

^
Data type was expected
Called from procedure – createaltertable at line 222
Called from procedure – dodbupgrade at line 57
Called from procedure – page1_section2_field1_click at line 5

My variables are all good so

Code:
?'alter table ' + tableName + ' add column ' + columnName + ' ' + colDefSql

resolves to

Code:
alter table TEMPLATE add column ID char(36) not null

A:
Try this:

Code:
tablename = "TEMPLATE"
columnName = "ID"
colDefSql = columnName + " char(36) not null"
sql = 'alter table ? add column ? '

prepare stmt from :sql
execute stmt using :tableName, :colDefSql

Going back to your original question, if you issue

Code:
set debug on

in the Lianja/VFP command window in the Console or App Inspector before running your code, you can check lianja\debug\debug.txt for errors.

The 3 parameter statement is shown as this (with associated error)

error message: Data type was expected
cmdbuf: alter table [TEMPLATE] add column ID [char(36) not null]

That looks to me like the ‘[]’ string delimiters are being retained and the data type clause therefore not being recognised. I’m not sure if that’s an invalid parameter use or whether this should be handled.


if you find any bugs in Lianja please let us know by submitting a ticket at http://www.lianja.com/support/newticket (Sign in to submit a ticket).

Please include detailed steps to reproduce the problem.
Any required App(s), data and Library files should be
attached to the ticket.
These can be
packaged into a Lianja Package File.
Send cut-down versions of your data where possible – you can create a backup copy for your database in the Data workspace, remove tables or records that are not required for the ticket, then restore your backup.
If you can
reproduce the problem using the sample southwind database, then even better.

If large files are required to reproduce the problem – the maximum ticket attachment size is 20MB – please contact support@lianja.com to request an ftp login and instructions on where to upload the files.

If you have more than one problem to report, please submit an individual ticket for each one.


Q:
in the log “MouseWheel detected”…

Code:
define class clsimage as image
  proc mousewheel(nModifiers, nXpos, nYpos)
    Lianja.writelog("MouseWheel detected")
    Lianja.writelog(nModifiers)
    Lianja.writelog(nXpos)
    Lianja.writelog(nYpos)
  endproc
enddefine

A:
You need to use ETOS() in the Lianja.writeLog() to convert to a string


Look at the is_object() function in the doc


On the client machine where you have run your installer, have a look at the drive:\lianja\log\log.txt file. This will include the dataDirectory and other directory settings it is using.
Check that this
directory contains the databases that you are expecting.

You can also use the –debug command line switch in your Lianja App Center shortcut, e.g. if installed on C:

C:\lianja\bin\lianjaruntime.exe –debug



This will then output debugging information to the debug.txt and/or debug_client.txt files in the C:\lianja\debug directory.


improved the debug error logging in 2.1 to hep you pinpoint hard to find errors.

The debug.txt file is now versioned for each run of the App Builder or the App Center e.g debug.txt becomes debug_.txt where is the process id of the running executable. Same goes fro debug_client_.txt.

You may want to purge these files periodically.


Q:
In Lianja App builder when I click to open ‘Lianja Demo App’ it seems that it tries to open it as indicated by a progress line bar on top bar but it closes the App builder without any error.
A:
1) set debug on, from the console, before you open the Lianja Demo App.
2) go to the debug directory (under Lianja), and open debug.txt.
Hint: get
Notepad++ and leave that file open. That way, when you click on it, Notepad++ will tell you the file has been modified by another program, and ask whether you want to refresh the version.
This way you
don’t have to go click on it every time.


compile your .prg files with the DEBUG keyword (compile myprg debug), and then set debug on,
and you will get a
line-by-line recitation of what fired in what order. And where it stopped firing.


1) compile all your prgs with the debug keyword.
2) on the conig.db file put in: set debug on — then compile it and move it to the deployment conf directory

You will then be able to see what is taking time when you open your app. I think: I haven’t tried this when spawning an app.


Lianja v3.0 now includes a GUI JavaScript debugger.

a note: when the JS debugger appears and has a permanent failure (this was a
missing reference to the lib_xxx.js file), the rest of the app will be locked until you close the debugger.
Makes sense, given that there is no place to go after that error, but could be confusing if you don’t realize it.



Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s