access to defined field

make

Member
Hi,
i have defined a temp-table and some fields:

define temp-table mytable
field ab as integer
field cd as char.

when i try to acces a field, with this code :

for each cust.xartikel no-lock
where xartikel.glas =215:
mytable.ab = substring(xartikel.artikel_nr,8,2,"Character").
end.

the compiler gives me an error-message :

cannot change field mytable.ab(142)

What can i do ?

Greetings
make
 

jongpau

Member
Hi Make,

Looks like you are trying to assign a character value into an integer field.

Try this:
Code:
mytable.ab = [b]integer([/b]substring(xartikel.artikel_nr,8,2,"Character":U)[b])[/b].
HTH
 

markis007

New Member
When using temp-tables you need to create records the same as any table in a database.

Try adding the following line after the for each:
create mytable.

This should allow you to set the value of mytable.ab.
 

make

Member
Thanks !!!!! And Next Question !

I have build a bowser Erg.w and now i want to run this from another widget/file. Both files are in the same directory.

Greetings

Make
 
Top