Good evening all,

I am in the process of writing a test program for my UTF8 classes. I am 
testing one of the methods and I am getting the runtime error of 111 
Variable expected. This is occurring when I assign the relevant value to 
a variable.

The method in question is

     method SkipBOM(str)
         local str1, str2, str3
         str1 := __Coerce(str)
         write(ximage(str1.Data()))
         str1.Data() ? {
             =__UTF8BOM
             write(str2 := tab(0))
         }
         str3 := UTF8.New(str2)             <--- line 434 in utf8.icn
         return str3
     end


The code from whence it is called is

     s5 := UTF8.SkipBOM(s4 || us1.Data()) <--- line 15 in utf8testbed.icn


The error messages and traceback from runtime are

"\xef\xbb\xbfabcde"
abcde

Run-time error 111
File utf8.icn; Line 434
variable expected
offending value: &null
Traceback:
    main()
    UTF8_SkipBOM(object 
UTF8_1(table_3(256),table_5(4),"\xef\xbb\xbf",table_4(256),"\xef\xbf\xbd",1,&null,&errout),"\xef\xbb\xbfabcde")
 
from line 15 in utf8testbed.icn
    {&null := object __UTF8Object_4("abcde",1,&null,&null)} from line 
434 in utf8.icn

         ^
         |
This is where str3 should be showing up. The ucode file has the 
following in it

proc UTF8_SkipBOM
     local    0,001000,self
     local    1,001000,str
     local    2,000020,str1
     local    3,000020,str2
     local    4,000020,str3         <-- variable used
     local    5,000000,write
     local    6,000000,ximage
     local    7,000000,tab
     con    0,002000,1,0
     declend
...
lab L3
     mark    L5
     pnull
     var    4                 <-- variable referenced
     pnull
     pnull
     var    0
     line    434
     colm    21
     synt    any
     field    UTF8
     line    434
     colm    26
     synt    any
     field    New
     var    3
     line    434
     colm    30
     synt    any
     invoke    1
     line    434
     colm    14
     synt    any
     asgn                <-- assignment
     unmark
...

The interesting thing is that the original code for the method gave a 
runtime error of 302 memory violation. The original method code was

     method SkipBOM(str)
         str := __Coerce(str)
         return str1.Data() ? {
             =__UTF8BOM
             UTF8.New(tab(0))
         }
     end


Current unicon version and features are

[bruce@localhost ibpag3]$ unicon -features
Unicon Version 12.3.  Sep 12, 2015
UNIX
POSIX
DBM
ASCII
co-expressions
concurrent threads
dynamic loading
environment variables
event monitoring
external functions
keyboard functions
large integers
multiple programs
pattern type
pipes
pseudo terminals
system function
messaging
graphics
3D graphics
X Windows
libz file compression
JPEG images
PNG images
Audio
operator overloading
CCompiler gcc 4.4.7
Physical memory: 1044389888 bytes
Revision 4209
Arch x86_32
CPU cores 4
Binaries at /home/bruce/unicon/bin/


Is there anything obvious that I am overlooking. I do use the -u option 
when compiling my code.

regards

Bruce Rennie


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to