1. Does 'seek' have to used with 'if'.....

Here's a brief code sample that fails on the first occurence of the 'seek'
attempt with this message:

Syntax error:
... "expected possibly to see 'end', not a function"
      'seek(fn, tobyte)'

include machine.e
   include file.e
   include get.e
   without warning
   without type_check	
   crash_file("error-messages.txt")
   integer fn 	
   integer tobyte
   sequence resdata 	
   fn=open("dsysmst.dat","rb")
   if fn < 1 then
  	puts(1, "Unable to open the disk file\n")
        abort(fn)
   else 
     tobyte = 0
     seek (fn, tobyte)
     for i = 1 to 10 do 
        resdata = get_bytes(fn, 40)
        puts(1, resdata & '\n')
        tobyte = tobyte + 2690
        seek (fn, tobyte)
     end for   
   end if  
   close(fn)
   puts(1,"Test display of records completed") 


new topic     » topic index » view message » categorize

2. Re: Does 'seek' have to used with 'if'.....

John F Dutcher wrote:

> Here's a brief code sample that fails on the first occurence of the 'seek'
> attempt with this message:
>
> Syntax error:
> ... "expected possibly to see 'end', not a function"
>       'seek(fn, tobyte)'
>
> }}}
<eucode>

<snip>

>    if fn < 1 then
>   	puts(1, "Unable to open the disk file\n")
>         abort(fn)
>    else
>      tobyte = 0
>      seek (fn, tobyte)

<snip>

> </eucode>
{{{


seek() is a function, so it must not be called like a procedure.
You can use the return value of a function like in
   print(1, seek(fn,tobyte))
   x = seek(fn,tobyte)

Of course, you also can write e.g.
   if seek(fn,tobyte) != 0 then
      puts(1, "Error!")
   end if

Regards,
   Juergen

-- 
A: Because it considerably reduces the readability of the text.
Q: Why?
A: Top posting.
Q: What is annoying in e-mail and news?

new topic     » goto parent     » topic index » view message » categorize

3. Re: Does 'seek' have to used with 'if'.....

John F Dutcher wrote:
> 
>    else 
>      tobyte = 0
>      seek (fn, tobyte)

seek() is a function, and therefore needs to be assigned to something.

For example:

   junk = seek(fn,tobyte) 


-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

4. Re: Does 'seek' have to used with 'if'.....

Hi,
thanks for your answer,
I do not understand the items. I just downloaded the samples and expected to
have a working program.
But that's not true. I walked exactly the instructions but nevertheless : no
success. Maybe you know what I am doing wrong with the isntallation
of some examples. So I noticed that to start a program I have to open a DOS-box.
Am I right?
Regards, Dirk

new topic     » goto parent     » topic index » view message » categorize

5. Re: Does 'seek' have to used with 'if'.....

On 15 Oct 2004, at 9:30, dirk dekker wrote:

>
>
> posted by: dirk dekker <dirk at induxion.nl>
>
> Hi,
> thanks for your answer,
> I do not understand the items. I just downloaded the samples and expected=
 to
> have a working program. But that's not true. I walked exactly the instruc=
tions
> but nevertheless : no success. Maybe you know what I am doing wrong with =
the
> isntallation of some examples.=20

This is where the confusion happens:
include file.e
i1 = seek(fn, i2)  <<== see it is assigned

Example:=20=20
 include file.e

integer fn
fn = open("mydata", "rb")
-- read and display first line of file 3 times:
for i = 1 to 3 do
    puts(1, gets(fn))

    if seek(fn, 0) then <<== no assign?

        puts(1, "rewind failed!\n")
    end if
end for

But there is an assignment made in the 2nd example, it is evaluated in the =
if
command. It's hidden. It's a concept of computer programming to pass the=

results of a function to another function without the programmer using it=

directly.

like:
trace(not(seek(fn, 0)))
puts(1,sprintf("%d",seek(fn, 0))&"\n")
set %swrk. [ $+ [ %net ] $+ . $+ [ %swrk.chan ] $+ ] .history $gettok(
%swrk. [ $+ [ %net ] $+ . $+ [ %swrk.chan ] $+ ] .history , 2- , $asc(=02) =
)


> So I noticed that to start a program I have to
> open a DOS-box. Am I right? Regards, Dirk

No. you do not haveto open any dosbox or window. But puts() to '1' is the=

dosbox, and will open a window. puts() to a file will not open a dosbox. Th=
e
windows and linux commands work differently. Look in the win32lib (or other=

windows libraries) examples for easy "real" windows writing. Geluk!

Kat

new topic     » goto parent     » topic index » view message » categorize

6. Re: Does 'seek' have to used with 'if'.....

Hi ,
when I start the example : web browser.exw; the result is an ex.err
See this below:

d:\EUPHORIA\include\win32lib.ew:7224 in function validId() 
type_check failure, id is 2131035746 
    id = 2131035746

... called from d:\EUPHORIA\include\win32lib.ew:10956 in function getSize()  
    id = 2131035746
    top = <no value>
    bottom = <no value>
    left = <no value>
    right = <no value>
    viewTop = <no value>
    viewLeft = <no value>
    struct = <no value>
    pt = <no value>
    hdc = <no value>

... called from d:\EUPHORIA\include\win32lib.ew:11190 in function getExtent()  
    id = 2131035746
    s = <no value>

... called from d:\EUPHORIA\include\win32lib.ew:15401 in procedure setSize()  
    id = 6
    cx = 377
    cy = 246
    x = <no value>
    y = <no value>
    oldBmp = 2131035746
    srcDC = <no value>
    dstDC = <no value>
    result = <no value>

... called from D:\web_browser exw\web browser.exw:647 in procedure
mainWindow_onResize()
    style = 0
    x = 392
    y = 246

... called from d:\EUPHORIA\include\win32lib.ew:17273 in function fDoSize()  
    id = 3
    hWnd = 5374492
    iMsg = 5
    wParam = 0
    lParam = 16122248
    pReturn = -2761
    cx = 392
    cy = 246
    lRC = {-2761}

... called from d:\EUPHORIA\include\win32lib.ew:18031 in function WndProc()  
    hWnd = 5374492
    iMsg = 5
    wParam = 0
    lParam = 16122248
    id = 3
    lHandledEvent = 8
    result = <no value>

^^^ call-back from Windows

... called from d:\EUPHORIA\include\win32lib.ew:18023 in function WndProc()  
    hWnd = 5374492
    iMsg = 71'G'
    wParam = 0
    lParam = 457804
    id = 3
    lHandledEvent = 0
    result = <no value>

^^^ call-back from Windows

... called from d:\EUPHORIA\include\win32lib.ew:18186 in procedure openWindow()
    id = 3
    style = 3
    hWnd = 5374492
    styleFlag = 3

... called from d:\EUPHORIA\include\win32lib.ew:18259 in procedure WinMain()  
    id = 3
    style = 3
    hWnd = <no value>
    msg = 787480

... called from D:\web_browser exw\web browser.exw:736 

Global & Local Variables

 d:\EUPHORIA\include\machine.e:
    mem = 611600
    check_calls = 1

 d:\EUPHORIA\include\misc.e:
    pretty_end_col = <no value>
    pretty_chars = <no value>
    pretty_start_col = <no value>
    pretty_level = <no value>
    pretty_file = <no value>
    pretty_ascii = <no value>
    pretty_indent = <no value>
    pretty_ascii_min = <no value>
    pretty_ascii_max = <no value>
    pretty_fp_format = <no value>
    pretty_int_format = <no value>
    pretty_line = <no value>

 d:\EUPHORIA\include\msgbox.e:
    lib = 2010185728
    msgbox_id = 0
    get_active_id = 1

 d:\EUPHORIA\include\file.e:
    SLASH = 92'\'
    my_dir = -2

 d:\EUPHORIA\include\get.e:
    input_file = <no value>
    input_string = <no value>
    string_next = <no value>
    ch = <no value>

 d:\EUPHORIA\include\graphics.e:
    BLUE = 1
    CYAN = 3
    RED = 4
    BROWN = 6
    BRIGHT_BLUE = 9
    BRIGHT_CYAN = 11
    BRIGHT_RED = 12
    YELLOW = 14

 d:\EUPHORIA\include\image.e:
    fn = <no value>
    error_code = <no value>
    numXPixels = <no value>
    numYPixels = <no value>
    bitCount = <no value>
    numRowBytes = <no value>
    startXPixel = <no value>
    startYPixel = <no value>
    endYPixel = <no value>

 d:\EUPHORIA\include\win32lib.ew:
    VOID = 1
    riCleanUp = 35'#'
    riGetSelf = 0
    riSetFocus = 32' '
    showWarnings = 1
    xUserCleanUp = -1
    user32 = 2010185728
    gdi32 = 2115502080
    winmm = 1991180288
    comdlg32 = 1983184896
    comctl32 = 1999634432
    kernel32 = 2011430912
    shell32 = 2000224256
    riched32 = 1931804672
    gvAllocatedAddr = {}
    allottedSize = 0
    classes = 50'2'
    Screen = 1
    Printer = 2
    className = {
                  0,
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {108'l',105'i',115's',116't',98'b',111'o',120'x'},
                  {108'l',105'i',115's',116't',98'b',111'o',120'x'},
                  {99'c',111'o',109'm',98'b',111'o',98'b',111'o',120'x'},
                  {99'c',111'o',109'm',98'b',111'o',98'b',111'o',120'x'},
                  {99'c',111'o',109'm',98'b',111'o',98'b',111'o',120'x'},
                  {99'c',111'o',109'm',98'b',111'o',98'b',111'o',120'x'},
                  {101'e',100'd',105'i',116't'},
                  {101'e',100'd',105'i',116't'},
                  {115's',116't',97'a',116't',105'i',99'c'},
                  {115's',116't',97'a',116't',105'i',99'c'},
                  {115's',116't',97'a',116't',105'i',99'c'},
                  {115's',99'c',114'r',111'o',108'l',108'l',98'b',97'a',
114'r'},
                  {115's',99'c',114'r',111'o',108'l',108'l',98'b',97'a',
114'r'},
                  {115's',116't',97'a',116't',105'i',99'c'},
                  {115's',116't',97'a',116't',105'i',99'c'},
                  {},
                  {},
                  {},
                  {},
                  {84'T',111'o',111'o',108'l',98'b',97'a',114'r',87'W',105'i',
110'n',100'd',111'o',119'w',51'3',50'2'},
                  {109'm',115's',99'c',116't',108'l',115's',95'_',115's',
116't',97'a',116't',117'u',115's',98'b',97'a',114'r',51'3',50'2'},
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {109'm',115's',99'c',116't',108'l',115's',95'_',116't',
114'r',97'a',99'c',107'k',98'b',97'a',114'r',51'3',50'2'},
                  {109'm',115's',99'c',116't',108'l',115's',95'_',116't',
114'r',97'a',99'c',107'k',98'b',97'a',114'r',51'3',50'2'},
                  {83'S',121'y',115's',84'T',97'a',98'b',67'C',111'o',110'n',
116't',114'r',111'o',108'l',51'3',50'2'},
                  0,
                  {109'm',115's',99'c',116't',108'l',115's',95'_',112'p',
114'r',111'o',103'g',114'r',101'e',115's',115's',51'3',50'2'},
                  {83'S',121'y',115's',76'L',105'i',115's',116't',86'V',
105'i',101'e',119'w',51'3',50'2'},
                  0,
                  {83'S',121'y',115's',84'T',114'r',101'e',101'e',86'V',
105'i',101'e',119'w',51'3',50'2'},
                  {82'R',105'i',99'c',104'h',69'E',100'd',105'i',116't'},
                  {83'S',121'y',115's',77'M',111'o',110'n',116't',104'h',
67'C',97'a',108'l',51'3',50'2'},
                  {109'm',115's',99'c',116't',108'l',115's',95'_',117'u',
112'p',100'd',111'o',119'w',110'n',51'3',50'2'},
                  {82'R',101'e',66'B',97'a',114'r',87'W',105'i',110'n',100'd',
111'o',119'w',51'3',50'2'},
                  0,
                  {116't',111'o',111'o',108'l',116't',105'i',112'p',115's',
95'_',99'c',108'l',97'a',115's',115's',51'3',50'2'},
                  {84'T',111'o',111'o',108'l',98'b',97'a',114'r',87'W',105'i',
110'n',100'd',111'o',119'w',51'3',50'2'},
                  {98'b',117'u',116't',116't',111'o',110'n'},
                  {67'C',111'o',109'm',98'b',111'o',66'B',111'o',120'x',
69'E',120'x',51'3',50'2'},
                  0,
                  0
                }
    classType = {0,1,1,1,1,1,1,4,4,2,2,2,2,3,3,6,6,6,5,5,6,6,7,8,9,10,11,
11,1,1,1,11,11,11,0,11,11,0,11,11,11,11,11,0,11,11,1,11,0,0}
    classStyle = {0,1342242816,1342242817,1342242819,1342242822,1342242825,
1342177287,1352728577,1352728579,1344340482,1344340738,1342243331,1344340483,
1350631552,1353777156,1342177280,1342177282,1342177281,1342242816,1342242817,
1342177283,1342177294,0,0,0,0,1417674757,1409286147,1342242944,1342246915,
1342247043,1342242849,1342242851,1375797248,0,1342177280,1350631488,0,1350631424,
1353818180,1350631424,1342177280,1451294752,0,1,1350633733,1,1342243842,
0,0}
    classStyleEx = {0,0,0,0,0,0,0,528,528,512,512,512,512,528,528,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,512,0,512,512,1,0,512,0,8,1,0,0,0,0}
    lv_id = {}
    lvitem_data = {}
    lvsort_column = {}
    il_id = <no value>
    icon_list = <no value>
    lv_allowsort = {}
    lvitem_owner = {}
    ilicon_list = {}
    ILlarge = 0
    ILsmall = 0
    tv_id = {}
    tvitem_data = {}
    tvitem_owner = {}
    tvitem_parent = {}
    tvitem_handle = {}
    himlFTBDefault = 0
    himlFTBHot = 0
    himlFTBDisabled = 0
    FTB_images = {}
    WndProcAddress = 10880952
    SubProcAddress = 10881056
    onMouse = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onClick = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,39''',-1,40'(',-1,41')',-1,
42'*'}
    onKeyPress = {-1,-1,-1,-1,-1,-1,-1,-1,-1,45'-',-1,-1,-1,-1,-1,-1,-1,-1}
    onKeyUp = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onKeyDown = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onResize = {-1,-1,38'&',-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onChange = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onGotFocus = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onLostFocus = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onScroll = {-1,-1,-1,-1,44',',-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onOpen = {-1,-1,36'$',-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onClose = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onDestroy = {-1,-1,37'%',-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onTimer = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onPaint = {-1,-1,-1,43'+',-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onDragAndDrop = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onEvent = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    mainWindow = 3
    modalWindow = 0
    modalhWnd = 0
    modalStack = {}
    paintDC = {}
    myId = {3}
    myReturn = {0}
    window_handle = {-1,-1,5374492,7340598,5702188,2265254441,7340580,24838544,
-1,34603446,6226791,6226791,6226791,6226791,18154353,18154353,177341425,
177341425}
    window_destroyed = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
window_func =
    {-1,-1,-1,2010238040,2010339980,-1,-64675,-64711,-1,2010304744,
-1,-1,-1,-1,-1,-1,-1,-1}
    window_class = {-1,-1,0,6,5,10,11,11,-1,3,7,9,9,9,7,9,7,9}
    window_type = {49'1',50'2',1,22,20,26,28,43'+',44',',14,23,25,25,25,23,
25,23,25}
    window_focus_order = {
                           {},
                           {},
                           {5,8},
                           {},
                           {},
                           {},
                           {},
                           {10},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {}
                         }
    window_focus = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    window_owner = {0,0,0,3,3,3,3,3,8,8,3,11,11,11,3,15,3,17}
    window_menu = {0,0,7144335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    window_toolbar = {0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    window_statusbar = {0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    window_tooltip = {{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},
{}}
    window_font = {
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0},
                    {{},0,0,0}
                  }
    window_fcolor = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    window_bcolor = {14933984,14933984,14933984,14933984,14933984,14933984,
14933984,14933984,14933984,14933984,14933984,14933984,14933984,14933984,
14933984,14933984,14933984,14933984}
    window_pen = {
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1},
                   {0,0,0,13,1,1}
                 }
    window_x = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    window_y = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    window_scroll = {
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {10,100'd'},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10},
                      {1,10}
                    }
    window_range = {
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'},
                     {0,100'd'}
                   }
    window_tabitems = {{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},
{}}
    window_group = {{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}}
    window_cursor = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    window_hotkey_keys = {
                           {},
                           {},
                           {70'F',79'O',88'X',86'V',83'S',72'H',65'A'},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {},
                           {}
                         }
    window_hotkey_ids = {
                          {},
                          {},
                          {11,12,14,15,16,17,18},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {},
                          {}
                        }
    window_textalign = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    tooltipControl = 0
    transColor = 16711935
    DefaultFontID = 25821223
    heldResource = {
                     {2131035746,6,-2,-1},
                     {2265254441,6,-2,-1}
                   }
    heldCursor = {}
    vFontWeight = 700
    vStockResources = {25821223,28311575,26214421,0,1,2,3,4,5,6,7,8,9,10,
11,12,13,14,15,16}
    i = 16
    printerDC = 0
    grabbedHDC = {}
    stream = {}
    regCount = 1
    customColors = 1400592
    i = 63'?'
    hintFontSize = 8
    hintFontAttrib = 0
    hintFontName = {77'M',83'S',32' ',83'S',97'a',110'n',115's',32' ',83'S',
101'e',114'r',105'i',102'f'}
    dragData = {}
    msgAddr = 787480
    vLMB_id = {-1,-1,-1,-1}
    vMaxClickTime = 0.5
    vMaxClickXDelta = 3
    vMaxClickYDelta = 3
    vEventsHandled = {512,513,516,514,517,515,518,5,7,8,256,258,257,273,563,
15,277,276,275,21,309,312,16,2,78'N',260,49541}
    vHandler = {15,15,15,15,15,15,15,16,17,18,19,19,19,20,21,22,23,23,24,
25,26,26,27,28,29,30,31}
    xpmErrFlag = <no value>
    transTuple = {255,0,255}
    pm = 0

 D:\web_browser exw\tcp4u.ew:
    TCP4U_MAX_MSG_SIZE = 16384
    TCP4U_STOP_STRING = {69'E',117'u',84'T',99'c',80'P',115's',84'T',111'o',
80'P'}
    myTcp4uLib = 268435456
    myTcp4uInit = 207
    myTcp4uCleanup = 208
    myTcp4uVer = 209
    myTcp4uEr = <no value>
    myTcp4uErrorString = 210
    myTcpGetLocalID = 211
    myTcpAccept = 212
    myTcpConnect = 213
    myTcpClose = 214
    myTcpFlush = 215
    myTcpGetListenSocket = 216
    myTcpSend = 217
    myTcpRecv = 218
    myTcpRecvUntilStr = 219
    myHttpIsValidURL = 225
    myHttp4uSetBufferSize = 222
    myHttp4uSetTimeout = 223
    myHttp4uErrorString = 224
    myHttpGetFile = 226
    myHttpGetFileEx = 227
    myTcpIsDataAvail = 220
    myTcpGetRemoteID = 221

 D:\web_browser exw\pic_load.e:
    junk = <no value>
    image = <no value>
    the_palette = <no value>
    bit_table = {
                  {0,0,0,0,0,0,0,0},
                  {1,0,0,0,0,0,0,0},
                  {0,1,0,0,0,0,0,0},
                  {1,1,0,0,0,0,0,0},
                  {0,0,1,0,0,0,0,0},
                  {1,0,1,0,0,0,0,0},
                  {0,1,1,0,0,0,0,0},
                  {1,1,1,0,0,0,0,0},
                  {0,0,0,1,0,0,0,0},
                  {1,0,0,1,0,0,0,0},
                  {0,1,0,1,0,0,0,0},
                  {1,1,0,1,0,0,0,0},
                  {0,0,1,1,0,0,0,0},
                  {1,0,1,1,0,0,0,0},
                  {0,1,1,1,0,0,0,0},
                  {1,1,1,1,0,0,0,0},
                  {0,0,0,0,1,0,0,0},
                  {1,0,0,0,1,0,0,0},
                  {0,1,0,0,1,0,0,0},
                  {1,1,0,0,1,0,0,0},
                  {0,0,1,0,1,0,0,0},
                  {1,0,1,0,1,0,0,0},
                  {0,1,1,0,1,0,0,0},
                  {1,1,1,0,1,0,0,0},
                  {0,0,0,1,1,0,0,0},
                  {1,0,0,1,1,0,0,0},
                  {0,1,0,1,1,0,0,0},
                  {1,1,0,1,1,0,0,0},
                  {0,0,1,1,1,0,0,0},
                  {1,0,1,1,1,0,0,0},
                  {0,1,1,1,1,0,0,0},
                  {1,1,1,1,1,0,0,0},
                  {0,0,0,0,0,1,0,0},
                  {1,0,0,0,0,1,0,0},
                  {0,1,0,0,0,1,0,0},
                  {1,1,0,0,0,1,0,0},
                  {0,0,1,0,0,1,0,0},
                  {1,0,1,0,0,1,0,0},
                  {0,1,1,0,0,1,0,0},
                  {1,1,1,0,0,1,0,0},
                  {0,0,0,1,0,1,0,0},
                  {1,0,0,1,0,1,0,0},
                  {0,1,0,1,0,1,0,0},
                  {1,1,0,1,0,1,0,0},
                  {0,0,1,1,0,1,0,0},
                  {1,0,1,1,0,1,0,0},
                  {0,1,1,1,0,1,0,0},
                  {1,1,1,1,0,1,0,0},
                  {0,0,0,0,1,1,0,0},
                  {1,0,0,0,1,1,0,0},
                  {0,1,0,0,1,1,0,0},
                  {1,1,0,0,1,1,0,0},
                  {0,0,1,0,1,1,0,0},
                  {1,0,1,0,1,1,0,0},
                  {0,1,1,0,1,1,0,0},
                  {1,1,1,0,1,1,0,0},
                  {0,0,0,1,1,1,0,0},
                  {1,0,0,1,1,1,0,0},
                  {0,1,0,1,1,1,0,0},
                  {1,1,0,1,1,1,0,0},
                  {0,0,1,1,1,1,0,0},
                  {1,0,1,1,1,1,0,0},
                  {0,1,1,1,1,1,0,0},
                  {1,1,1,1,1,1,0,0},
                  {0,0,0,0,0,0,1,0},
                  {1,0,0,0,0,0,1,0},
                  {0,1,0,0,0,0,1,0},
                  {1,1,0,0,0,0,1,0},
                  {0,0,1,0,0,0,1,0},
                  {1,0,1,0,0,0,1,0},
                  {0,1,1,0,0,0,1,0},
                  {1,1,1,0,0,0,1,0},
                  {0,0,0,1,0,0,1,0},
                  {1,0,0,1,0,0,1,0},
                  {0,1,0,1,0,0,1,0},
                  {1,1,0,1,0,0,1,0},
                  {0,0,1,1,0,0,1,0},
                  {1,0,1,1,0,0,1,0},
                  {0,1,1,1,0,0,1,0},
                  {1,1,1,1,0,0,1,0},
                  {0,0,0,0,1,0,1,0},
                  {1,0,0,0,1,0,1,0},
                  {0,1,0,0,1,0,1,0},
                  {1,1,0,0,1,0,1,0},
                  {0,0,1,0,1,0,1,0},
                  {1,0,1,0,1,0,1,0},
                  {0,1,1,0,1,0,1,0},
                  {1,1,1,0,1,0,1,0},
                  {0,0,0,1,1,0,1,0},
                  {1,0,0,1,1,0,1,0},
                  {0,1,0,1,1,0,1,0},
                  {1,1,0,1,1,0,1,0},
                  {0,0,1,1,1,0,1,0},
                  {1,0,1,1,1,0,1,0},
                  {0,1,1,1,1,0,1,0},
                  {1,1,1,1,1,0,1,0},
                  {0,0,0,0,0,1,1,0},
                  {1,0,0,0,0,1,1,0},
                  {0,1,0,0,0,1,1,0},
                  {1,1,0,0,0,1,1,0},
                  {0,0,1,0,0,1,1,0},
                  {1,0,1,0,0,1,1,0},
                  {0,1,1,0,0,1,1,0},
                  {1,1,1,0,0,1,1,0},
                  {0,0,0,1,0,1,1,0},
                  {1,0,0,1,0,1,1,0},
                  {0,1,0,1,0,1,1,0},
                  {1,1,0,1,0,1,1,0},
                  {0,0,1,1,0,1,1,0},
                  {1,0,1,1,0,1,1,0},
                  {0,1,1,1,0,1,1,0},
                  {1,1,1,1,0,1,1,0},
                  {0,0,0,0,1,1,1,0},
                  {1,0,0,0,1,1,1,0},
                  {0,1,0,0,1,1,1,0},
                  {1,1,0,0,1,1,1,0},
                  {0,0,1,0,1,1,1,0},
                  {1,0,1,0,1,1,1,0},
                  {0,1,1,0,1,1,1,0},
                  {1,1,1,0,1,1,1,0},
                  {0,0,0,1,1,1,1,0},
                  {1,0,0,1,1,1,1,0},
                  {0,1,0,1,1,1,1,0},
                  {1,1,0,1,1,1,1,0},
                  {0,0,1,1,1,1,1,0},
                  {1,0,1,1,1,1,1,0},
                  {0,1,1,1,1,1,1,0},
                  {1,1,1,1,1,1,1,0},
                  {0,0,0,0,0,0,0,1},
                  {1,0,0,0,0,0,0,1},
                  {0,1,0,0,0,0,0,1},
                  {1,1,0,0,0,0,0,1},
                  {0,0,1,0,0,0,0,1},
                  {1,0,1,0,0,0,0,1},
                  {0,1,1,0,0,0,0,1},
                  {1,1,1,0,0,0,0,1},
                  {0,0,0,1,0,0,0,1},
                  {1,0,0,1,0,0,0,1},
                  {0,1,0,1,0,0,0,1},
                  {1,1,0,1,0,0,0,1},
                  {0,0,1,1,0,0,0,1},
                  {1,0,1,1,0,0,0,1},
                  {0,1,1,1,0,0,0,1},
                  {1,1,1,1,0,0,0,1},
                  {0,0,0,0,1,0,0,1},
                  {1,0,0,0,1,0,0,1},
                  {0,1,0,0,1,0,0,1},
                  {1,1,0,0,1,0,0,1},
                  {0,0,1,0,1,0,0,1},
                  {1,0,1,0,1,0,0,1},
                  {0,1,1,0,1,0,0,1},
                  {1,1,1,0,1,0,0,1},
                  {0,0,0,1,1,0,0,1},
                  {1,0,0,1,1,0,0,1},
                  {0,1,0,1,1,0,0,1},
                  {1,1,0,1,1,0,0,1},
                  {0,0,1,1,1,0,0,1},
                  {1,0,1,1,1,0,0,1},
                  {0,1,1,1,1,0,0,1},
                  {1,1,1,1,1,0,0,1},
                  {0,0,0,0,0,1,0,1},
                  {1,0,0,0,0,1,0,1},
                  {0,1,0,0,0,1,0,1},
                  {1,1,0,0,0,1,0,1},
                  {0,0,1,0,0,1,0,1},
                  {1,0,1,0,0,1,0,1},
                  {0,1,1,0,0,1,0,1},
                  {1,1,1,0,0,1,0,1},
                  {0,0,0,1,0,1,0,1},
                  {1,0,0,1,0,1,0,1},
                  {0,1,0,1,0,1,0,1},
                  {1,1,0,1,0,1,0,1},
                  {0,0,1,1,0,1,0,1},
                  {1,0,1,1,0,1,0,1},
                  {0,1,1,1,0,1,0,1},
                  {1,1,1,1,0,1,0,1},
                  {0,0,0,0,1,1,0,1},
                  {1,0,0,0,1,1,0,1},
                  {0,1,0,0,1,1,0,1},
                  {1,1,0,0,1,1,0,1},
                  {0,0,1,0,1,1,0,1},
                  {1,0,1,0,1,1,0,1},
                  {0,1,1,0,1,1,0,1},
                  {1,1,1,0,1,1,0,1},
                  {0,0,0,1,1,1,0,1},
                  {1,0,0,1,1,1,0,1},
                  {0,1,0,1,1,1,0,1},
                  {1,1,0,1,1,1,0,1},
                  {0,0,1,1,1,1,0,1},
                  {1,0,1,1,1,1,0,1},
                  {0,1,1,1,1,1,0,1},
                  {1,1,1,1,1,1,0,1},
                  {0,0,0,0,0,0,1,1},
                  {1,0,0,0,0,0,1,1},
                  {0,1,0,0,0,0,1,1},
                  {1,1,0,0,0,0,1,1},
                  {0,0,1,0,0,0,1,1},
                  {1,0,1,0,0,0,1,1},
                  {0,1,1,0,0,0,1,1},
                  {1,1,1,0,0,0,1,1},
                  {0,0,0,1,0,0,1,1},
                  {1,0,0,1,0,0,1,1},
                  {0,1,0,1,0,0,1,1},
                  {1,1,0,1,0,0,1,1},
                  {0,0,1,1,0,0,1,1},
                  {1,0,1,1,0,0,1,1},
                  {0,1,1,1,0,0,1,1},
                  {1,1,1,1,0,0,1,1},
                  {0,0,0,0,1,0,1,1},
                  {1,0,0,0,1,0,1,1},
                  {0,1,0,0,1,0,1,1},
                  {1,1,0,0,1,0,1,1},
                  {0,0,1,0,1,0,1,1},
                  {1,0,1,0,1,0,1,1},
                  {0,1,1,0,1,0,1,1},
                  {1,1,1,0,1,0,1,1},
                  {0,0,0,1,1,0,1,1},
                  {1,0,0,1,1,0,1,1},
                  {0,1,0,1,1,0,1,1},
                  {1,1,0,1,1,0,1,1},
                  {0,0,1,1,1,0,1,1},
                  {1,0,1,1,1,0,1,1},
                  {0,1,1,1,1,0,1,1},
                  {1,1,1,1,1,0,1,1},
                  {0,0,0,0,0,1,1,1},
                  {1,0,0,0,0,1,1,1},
                  {0,1,0,0,0,1,1,1},
                  {1,1,0,0,0,1,1,1},
                  {0,0,1,0,0,1,1,1},
                  {1,0,1,0,0,1,1,1},
                  {0,1,1,0,0,1,1,1},
                  {1,1,1,0,0,1,1,1},
                  {0,0,0,1,0,1,1,1},
                  {1,0,0,1,0,1,1,1},
                  {0,1,0,1,0,1,1,1},
                  {1,1,0,1,0,1,1,1},
                  {0,0,1,1,0,1,1,1},
                  {1,0,1,1,0,1,1,1},
                  {0,1,1,1,0,1,1,1},
                  {1,1,1,1,0,1,1,1},
                  {0,0,0,0,1,1,1,1},
                  {1,0,0,0,1,1,1,1},
                  {0,1,0,0,1,1,1,1},
                  {1,1,0,0,1,1,1,1},
                  {0,0,1,0,1,1,1,1},
                  {1,0,1,0,1,1,1,1},
                  {0,1,1,0,1,1,1,1},
                  {1,1,1,0,1,1,1,1},
                  {0,0,0,1,1,1,1,1},
                  {1,0,0,1,1,1,1,1},
                  {0,1,0,1,1,1,1,1},
                  {1,1,0,1,1,1,1,1},
                  {0,0,1,1,1,1,1,1},
                  {1,0,1,1,1,1,1,1},
                  {0,1,1,1,1,1,1,1},
                  {1,1,1,1,1,1,1,1}
                }
    file_num = <no value>
    exit_flag = <no value>
    palette_at_end = <no value>
    x_size = <no value>
    y_size = <no value>
    bits_per_pixel = <no value>
    n_colors = <no value>
    background = <no value>
    bytes_per_line = <no value>
    x_min = <no value>
    x_max = <no value>
    y_min = <no value>
    y_max = <no value>
    n_planes = <no value>
    n = 255

 D:\web_browser exw\web browser.exw:
    textX = 1
    textY = 1
    fontSize = <no value>
    xSize = 377
    ySize = 246
    bold = <no value>
    italic = <no value>
    underline = <no value>
    filename = {}
    currentSource = {}
    pageTitle = {}
    fontName = <no value>
    url = {}
    fontColor = <no value>
    clientArea = {0,28,392,226}
    proxy = {}
    bgColor = <no value>
    html = <no value>
    head = <no value>
    title = <no value>
    body = <no value>
    b = <no value>
    i = <no value>
    h1 = <no value>
    h2 = <no value>
    h3 = <no value>
    font = <no value>
    pre = <no value>
    a = <no value>
    u = <no value>
    p = <no value>
    ended = <no value>


Traced lines leading up to the failure:

d:\EUPHORIA\include\win32lib.ew:9172	        window_handle[ id ] = handle
d:\EUPHORIA\include\win32lib.ew:9175	        trackObject( id, handle, ForProgram
)
d:\EUPHORIA\include\win32lib.ew:7058	   if atom(pObject)
d:\EUPHORIA\include\win32lib.ew:7060	      hResource = pObject
d:\EUPHORIA\include\win32lib.ew:7061	      lTag = -1
d:\EUPHORIA\include\win32lib.ew:7067	    if  not isStockResource( hResource )
d:\EUPHORIA\include\win32lib.ew:6992	    return find(a, vStockResources)
d:\EUPHORIA\include\win32lib.ew:960	    for i = 1 to length( list ) do
d:\EUPHORIA\include\win32lib.ew:961	        if equal( list[i][1], key ) then
d:\EUPHORIA\include\win32lib.ew:964	    end for
d:\EUPHORIA\include\win32lib.ew:965	    return 0
d:\EUPHORIA\include\win32lib.ew:7072	        res = NewRes
d:\EUPHORIA\include\win32lib.ew:7073	        res[ResHandle] = hResource
d:\EUPHORIA\include\win32lib.ew:7074	        res[ResOwner]  = owner
d:\EUPHORIA\include\win32lib.ew:7075	        res[ResLife]   = lifetime
d:\EUPHORIA\include\win32lib.ew:7076	        res[ResTag]    = lTag
d:\EUPHORIA\include\win32lib.ew:7078	        heldResource = append(
heldResource, res )
d:\EUPHORIA\include\win32lib.ew:7081	end procedure
d:\EUPHORIA\include\win32lib.ew:9183	end procedure
d:\EUPHORIA\include\win32lib.ew:15395	        if oldBmp != 0 then
d:\EUPHORIA\include\win32lib.ew:15398	            if window_handle[ id ] != 0
then
d:\EUPHORIA\include\win32lib.ew:15401	                result = getExtent( oldBmp
)
d:\EUPHORIA\include\win32lib.ew:11190	    s = getSize( id )
d:\EUPHORIA\include\win32lib.ew:10941	    if id = Screen
d:\EUPHORIA\include\win32lib.ew:10956	    elsif not validId( id ) then


----------ex.err----------------
I don't understand why a  working example from the archive 
is for specialist only. I am a beginner and very intersted in euphoria but till
now I am not hapy with it....

see below what I downloaded and tried to work on XP-prof:
 
WIN Web Browser 181K Andrew Mar 22/02  1.00   
A simple Web browser using Win32Lib. He's looking for people to help out with
it.

Regards, Dirk

new topic     » goto parent     » topic index » view message » categorize

7. Re: Does 'seek' have to used with 'if'.....

dirk dekker wrote:
> 
> Hi ,
> when I start the example : web browser.exw; the result is an ex.err
> See this below:
> 
> d:\EUPHORIA\include\win32lib.ew:7224 in function validId() 
> ... called from d:\EUPHORIA\include\win32lib.ew:10956 in function getSize()  
> ... called from d:\EUPHORIA\include\win32lib.ew:11190 in function getExtent() 
>

I think you are using an old version of Win32Lib. The line numbers you 
refer to here are not in the functions named, at least not in the latest 
version (60.6) of Win32lib.

Irv

new topic     » goto parent     » topic index » view message » categorize

8. Re: Does 'seek' have to used with 'if'.....

Hi, where I do find the latest  Win32lib
Dirk Dekker
----- Oorspronkelijk bericht ----- 
Van: "irv mullins" <guest at RapidEuphoria.com>
Aan: <EUforum at topica.com>
Verzonden: vrijdag 15 oktober 2004 20:32
Onderwerp: Re: Does 'seek' have to used with 'if'.....


|
|
| posted by: irv mullins <irvm at ellijay.com>
|
| dirk dekker wrote:
| >
| > Hi ,
| > when I start the example : web browser.exw; the result is an ex.err
| > See this below:
| >
| > d:\EUPHORIA\include\win32lib.ew:7224 in function validId()
| > ... called from d:\EUPHORIA\include\win32lib.ew:10956 in function
getSize()
| > ... called from d:\EUPHORIA\include\win32lib.ew:11190 in function
getExtent()
|
| I think you are using an old version of Win32Lib. The line numbers you
| refer to here are not in the functions named, at least not in the latest
| version (60.6) of Win32lib.
|
| Irv
|
|
|
|
|

new topic     » goto parent     » topic index » view message » categorize

9. Re: Does 'seek' have to used with 'if'.....

John F Dutcher wrote:
> 
> Here's a brief code sample that fails on the first occurence of the 'seek'
> attempt with this message:
> 
> Syntax error:
> ... "expected possibly to see 'end', not a function"
>       'seek(fn, tobyte)'

Hi John,
yes, you fell for the old 'using-a-function-as-a-procedure' trick. I fall
the same thing at least half a dozen times a day too! blink

The rule in Euphoria is that a program *must* always do something with
the returned value from a function call. And 'seek' is a function. It 
always returns a value. Its your choice how you use it, but you must 
use it.

The value that 'seek' returns can be useful at times, but one easy way
to ignore it is to do this sort of thing ...

First, create a new *procedure*. Something like this will do ...

  procedure set_file_position(integer fn, atom where)
     fn = seek(fn,where)
  end procedure

Then instead of using 'seek', use 'set_file_position'!

Such as ...

   tobyte = 0
   set_file_position(fn, tobyte)


Hope this helps.
-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu