Re: Syntax error reported but I cannot see it
"James B. Byrne via Aubit4gl-discuss" <[email protected]> Wed, 10 Mar 2021 13:58:55 -0500
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <[email protected]> |
On Wed, March 10, 2021 12:55, Peter Schubert SACO GmbH wrote:
> Am 10.03.21 um 18:43 schrieb James B. Byrne via Aubit4gl-discuss:
>> Err:Program ./ex11.4ae stopped at 'ex11.4gl', line number 859.
>> Error status number -201.
>> syntax error at or near "S".
>>
>> 4gl function call stack :
>> ex11.4gl (Line 469) calls stock_popup(stock_item=)
>> ex11.4gl (Line 172) calls input_items()
>> ex11.4gl (Line 90) calls add_order()
>> MAIN
>>
>>
>>
>> The code referred to in the error message is:
>>
>> 837 LET st_stock =
>> 838 "SELECT stock_num, description, stock.manu_code,
>> manufact.manu_name, ",
>> 839 "unit, unit_price FROM stock, manufact"
>> 840
>> 841 IF stock_item IS NOT NULL
>> 842 THEN
>> 843 LET st_stock = st_stock CLIPPED,
>> 844 " WHERE stock_num = ", stock_item,
>> 845 " AND stock.manu_code = manufact.manu_code",
>> 846 " ORDER BY 1, 3"
>> 847 ELSE
>> 848 LET st_stock = st_stock CLIPPED,
>> 849 " WHERE stock.manu_code = manufact.manu_code",
>> 850 " ORDER BY 1, 3"
>> 851 END IF
>> 852
>> 853 PREPARE slct_run FROM st_stock
>> 854 DECLARE c_stockpop CURSOR FOR slct_run
>> 855
>> 856 LET over_size = FALSE
>> 857 LET stock_cnt = 1
>> 858
>> 859 FOREACH c_stockpop INTO pa_stock[stock_cnt].*
>> 860 LET stock_cnt = stock_cnt + 1
>> 861 IF stock_cnt > array_sz THEN
>> 862 LET over_size = TRUE
>> 863 EXIT FOREACH
>> 864 END IF
>> 865 END FOREACH
>> 866
>>
>> I just cannot see what is wrong with that code. Can anyone else see what it
>> is?
>
> all my code is based on 4gl 7.20.
> So i define a record the the FOREACH and move the content inside the
> FOREACH block in the ARRAY.
> Give it a try.
> > 859 FOREACH c_stockpop INTO tmp_stock.*
> 859 1/2 LET pa_stock[stock_cnt].* = tmp_stock.*
> > 860 LET stock_cnt = stock_cnt + 1
> > 861 IF stock_cnt > array_sz THEN
> > 862 LET over_size = TRUE
> > 863 EXIT FOREACH
> > 864 END IF
> > 865 END FOREACH
>
I actually solved this issue by adding CLIPPED to the end of 839. At least,
the compiler error went away.
Thank you for the help.
Regards,
--
*** e-Mail is NOT a SECURE channel ***
Do NOT transmit sensitive data via e-Mail
Unencrypted messages have no legal claim to privacy
Do NOT open attachments nor follow links sent by e-Mail
James B. Byrne mailto:[email protected]
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3