Re: From List File Types Box Choose .ex RUNS but .exw does not -- Help please Prog exerpt shown

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

Hi Euphoria ,

New to this language but have hacked my way

to the following .......

When I choose the euphoria file type .ex it runs program selected.

If I choose euphoria file type .exw .... it does not run .

........... Code is pretty hopeless but I am trying to learn Why O.K. with .ex and not with .exw ???

I look forward to your reply ... in anticipation

yours Selgor

cheers.

CODE := below

 
constant FileTypes = { 
"dialog flags", {OFN_ALLOWMULTISELECT}, 
"Euphoria File", "*.ex", 
"Euphoria File", "*.exw"} 
 
procedure menuopen() 
    integer at, result     --was sat   could be rat cat mat whatever  
    sequence fName, fame 
        
    fName = getOpenFileName( MainWindow, "", FileTypes ) 
    if length( fName ) = 0 then 
        return 
    end if 
 
    setText( SLE, fName ) 
    setText( SLE, fName ) 
    setOpenFileName( fName )     
 
    if length( openfilename ) then 
          fame = fName 
 
       at = find( '.', fame ) 
       if at then 
            fame = fame[1..at-1] 
             fame &= ".ex" 
             result = system_exec( "ex \"" & fame & "\"",2 ) 
       elsif at then 
            fame = fame[1..at-1] 
             fame &= ".exw" 
             result = system_exec( "exw \"" & fame & "\"",2 ) 
        end if   
    end if   
--  end if 
end procedure 
 

Because "elsif at" is never entered, since program execution first encounters the initial "if at"?

And you probably don't mean for both if tests to be the exact same??

also note the <eucode> </eucode> I added before and after your code sample, that's what makes it "pretty print"; the Creole stuff at the top is supposed to add that, I think, but it never has worked for me, so you can just add it manually to code samples to make better viewing.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu