[VAPP/AS] problems with setting fields

Kurt Klamp K.Klamp at t-online.de
Sat Sep 20 15:59:36 CDT 2003


Ruslan Zasukhin wrote at 20.09.2003 14:04 Uhr

Hi Ruslan,

>Hi Kurt,
>
>> i've problems with the set command in AS. Did yoou changed something in
>> rules of syntax since 1.9.8 ?
>
>No, only record locks was added.

I know. But mistery is that old scripts work without adding new lock 
properties(default lock is 'readonly' and cursor change recorsd though)


> 
>> There is no chance to fill the fields of a cursor with the code
>> 
>>> set fields of cursor to {.......}
>> 
>> In this form VAPP crashes with error 15
>
>Does my examples works?
 NO

in example 102 i changed the line

:: make new record with data {...} at end of curs   / which works !!
into

:: make new record at end of curs
:: set fields of curs to {0, i as string, "some address", photo}
:: update curs

and i get the same error. Here is the evnt protojoll of scripteditor:
______
tell application "Valentina PPC"
	choose file with prompt "Choose database file" of type {"Vdsc"}
		--> alias "MHD Programme:Programme:Valentina:TESTumgebung:Customers"
	open alias "MHD Programme:Programme:Valentina:TESTumgebung:Customers"
		--> databases "Customers"
	get base object "Customer" of database "Customers"
		--> base objects "Customer" of databases "Customers"
	get base object "Invoice" of database "Customers"
		--> base objects "Invoice" of databases "Customers"
	SQL database "Customers" Select "SELECT  RecID, * FROM Customer"
		--> cursors 3 of databases "Customers"
	SQL database "Customers" Select "SELECT * FROM Invoice"
		--> cursors 4 of databases "Customers"
	make new record at end of cursor 3 of database "Customers"
		--> records id 7 of cursors 3 of databases "Customers"
	get field "RecID" of cursor 3 of database "Customers"
		--> 7
	set every field of cursor 3 of database "Customers" to {0, "1", "some 
address", 
"klfdjghlkdfjglksdfjglskd;fjgls;kdfjgl;kdsfjglsdkf;gjlk;fsdjglnmvbld;skfjgs
ldkflnmdks"}
		--> Valentina PPC got an error: Some parameter is missing for set.
_________
>
>Have you see that in SQL exmaples I have add 3 parameters to Sql Select?
>

Yes. See the above said.

>
>> If i write
>> 
>>> set every field of cursor to {....}
>> it compiles to
>>> set every fields of cursor to {......}
>> and on run there is no crash but the error 'Val. is missing some
>> parameter. But the value list is the same iget with 'set thelist to get
>> fields of cursor.
>> 
>> If i try
>>> set field 1 thru n of cursor to {.....}
>> a crash as result.
>> 
>> the only way which works is to set each field one after another via
>>> set field n of cursor to item n of valuelist
>> 
>> Am i doing something wrong?
>> 
>> 
>> BTW: i noticed something strange. In the AS dictionary of Vapp there
>> seems to recide only plurals of classes. The most classes are changed to
>> their plural form on compiling.
>> 
>> For example the value of  a ptr field:
>>> records id 1 of base objects "Investments" of databases "P_Daten"
>> or some references:
>>> databases "P_Daten"
>> 
>>> cursors 1 of databases "P_Daten"
>> 
>> Each element is compiled to plural. May be thats the reason for the 'set
>> fields ...' problem

What's your statement about the BTW ?

Best,
Kurt


More information about the Valentina mailing list