I think move(many()) is the type of thing that ought to trigger a warning
in the Unicon translator.   Now, if I can just remember it long enough to
write it down on the helpwanted.html or the secret todo.html that would be
nice.

Another performance warning ought to be triggered by many(" ") since it is
perfectly legal and semantically well defined and the translator ought to
translate it to many(' ') since conversion of strings to csets is kinda
slow and this may be happening thousands or millions of times inside a loop.

Clint



On Sun, Mar 10, 2013 at 8:42 AM, Jafar Al-Gharaibeh <to.ja...@gmail.com>wrote:

> Bruce,
>
>    After looking at your program and trying to refresh my memory in string
> scanning functions, I believe your problem is using move() in place of
> tab().  After doing that change, your program run to completion with no
> issues on m sides.
>
> Cheers,
> Jafar
>
>
>
>
> On Sun, Mar 10, 2013 at 9:09 AM, Bruce & Breeanna Rennie <
> bren...@dcsi.net.au> wrote:
>
>>  Good morning to all,
>>
>> I have the following unicon program
>>
>> procedure main()
>>     local inp, outp, line, trials, credit, items, itemsl, itemol, i, j,
>> cnt, eli, p1, p2, el2, trace
>>     inp := open("sc.txt", "rt")
>>     outp := open("scr.txt", "w")
>>     trace := open("trace.txt", "w")
>>     itemol := list()
>>     itemsl := list()
>>     items := set()
>>     trials := read(inp) + 0
>>     write(trace, "$", trials, "$")
>>     every i := 1 to trials do {
>>         credit := read(inp) + 0
>>         write(trace, "credit:", credit)
>>         cnt := read(inp) + 0
>>         write(trace, "cnt:", cnt)
>>         j := 1
>>         write(trace, line := read(inp)) ? while j <= cnt do {
>>             write(trace, "j:", j)
>>             write(trace, "&subject:", &subject)
>>             write(trace, "&pos:", &pos)
>>             move(many(" "))
>>             write(trace, "&pos:", &pos)
>>             write(trace, "#", &digits, "#")
>>             (eli := move(many(&digits)))                      # <====
>> problem line
>>             write(trace, "&pos:", &pos)
>>             write(trace, eli)
>>             insert(items, credit >= eli)
>>             itemol := put(itemol, eli)
>>             itemsl := put(itemsl, credit >= eli)
>>             j +:= 1
>>         }
>>         itemsl := sort(itemsl)
>>         while /p1 | /p2 do {
>>             eli := pop(itemsl)
>>             el2 := credit - eli
>>             if member(items, el2) then
>>                 every j := 1 to cnt do {
>>                     /p1 := (itemol[j] = eli) & j
>>                     p2 := (itemol[j] = el2) & j
>>                 }
>>         }
>>         write(outp, "case #", i, (p1 > p2) | p1 ,(p1 <= p2) | p1)
>>     }
>> end
>>
>>
>> which is giving the following error
>>
>> Run-time error 102
>> File storecredit.icn; Line 27
>> numeric expected
>> offending value: "75 25"
>> Traceback:
>>    main()
>>    {100 >= "75 25"} from line 27 in storecredit.icn
>>
>> The data file being used is attached as well as the trace file created
>> during the program run. Is there an error between keyboard and chair or is
>> it in the function many(). I expected that the value being returned back
>> from the line marked above should have been "75". What I did notice was
>> that the first time through, the value of &pos was expected to be 2 but was
>> 3 instead.
>>
>> I am running 32 bit linux Fedora 17 on a Toshiba NB500 netbook.with the
>> following Unicon version
>>
>> unicon -version
>> Unicon Version 12.1.  November 19, 2012
>>
>> regards
>>
>> Bruce Rennie
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
>> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
>> endpoint security space. For insight on selecting the right partner to
>> tackle endpoint security challenges, access the full report.
>> http://p.sf.net/sfu/symantec-dev2dev
>> _______________________________________________
>> Unicon-group mailing list
>> Unicon-group@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/unicon-group
>>
>>
>
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> Unicon-group mailing list
> Unicon-group@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/unicon-group
>
>
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to