Re: Phix : string type -> type check failure

new topic     » goto parent     » topic index » view thread      » older message » newer message
ChrisB said...

what is the difference between a dword-sequence and a string?

One typechecks and the other doesn't smile

Maybe the last bit of code below will help, but if the glossary in the manual (contains both those terms) does not make it clear, not sure what else I can say...

ChrisB said...

Edit : I've just read this and it looks a bit abrupt. Not my intention, merely abstracting a Joe programmer. Cheers, Chris

No worries. Not personal, just heated and lively debate. Got it.


My problem is change get_file_name() and there are two dozen others that should follow suit.
- however I genuinely value those kind of typechecks, though maybe I could "if not string(s) then s := eight_bit_string(s) end if" times 24...
Another problem is that EuWinGUI is (annoyingly) closed source and therefore difficult to support properly on Phix (and 32-bit-Windows only).
You know that above it actually returned "{67,58,92,80,104,105,120,92,80,114,111,103,1.. ", literally that exact specific string...? (Ugh/Yeuk)

Anyway, I have a suggestion. Change EuWinGUI.ew

global function FileDlg(atom dlgtype, sequence filename, sequence filter) 
--  return v3_c_func(filedlg,{dlgtype,filename,filter}) 
    return v3_c_funcs(filedlg,{dlgtype,filename,filter}) 
end function 

While you are there, GetText() can take the same treatment.
Then, add that/this new function into euconvertinc.e:

public function v3_c_funcs(integer func, sequence args) 
    sequence q = v3_c_func(func, args) 
    integer l = length(q) 
    string res = repeat(' ',l) 
    for i=1 to l do 
        res[i] = q[i] 
    end for 
    return res 
end function 

EDIT: Just after posting, I realised there may be a problem in value(). I haven't tried changing this, but in get.e/Get(), line 298 there is indeed:

            -- process a sequence 
            s = {} 

Now if s started off as "" instead, it might return a string, and avoid all this mess...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu