Author Topic: Not standard  (Read 2264 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
Not standard
« on: March 02, 2015, 03:36:12 PM »
sorry Charles
I just download latest full oxygen pack and try ...
and i am disappointed ... ::)
Not work ...
First i really don't know what you do now ...
standard ShellExecute not work with new compiler and this is not NORMAL.

or
why this code not work ? because work in all other compilers..
sRet = ShellExecute 0,"open","\gxo2.exe","-c "+chr(34)+fName+chr(34),"",5

EDIT:
I have a luck that i keep original Emergence Basic version of OxyEdit and found what is WRONG
now...geee
sRet = ShellExecute 0,"open","/gxo2.exe","-c"+fName,"",5

ps..i change title ...

.
« Last Edit: March 02, 2015, 11:06:11 PM by Aurel »

Mike Lobanovsky

  • Guest
Re: Not Normal
« Reply #1 on: March 02, 2015, 05:40:33 PM »
Aurel,

The code you typed in red may not work in some compilers or interpreters. That depends on their ability to accept enquoted filenames/filepaths in order to describe some of them that would have spaces. The compiler or interpreter will see the expression

chr(34) + fName + chr(34)

in its shelled command line as literal

"filename.ext"

or generally

"diskname:\path name\file name.ext"

The variant typed in blue would be much safer unless fName is a filename and/or filepath with spaces in it, like e.g. in C:\Program Files\someprog.exe. But it would certainly fail as well if fName contains at least one space.

OTOH even your

"-c" + fName

might not work either just because you missed a space after -c before concatenation. It should've been

"-c " + fName

else many more Windows-oriented interpreters and compilers won't be able to tell where the -c directive ends and the fName value starts. Concatenated unspaced options are typical under Linux but look totally out of place under MS Windows.

...
(& I always start with the idea that it is me who made the mistake)
...

I think that's what all of us should do too. :)

Aurel

  • Guest
Re: Not Normal
« Reply #2 on: March 02, 2015, 10:34:51 PM »
Mike
I know for ploblematic with blank space in filename
but here is problem in constant changes ...
Now is proper way -> "-c"  and older version is -> "-c ".
I think that i will take a break from oxygen and use another compiler .

Charles Pegge

  • Guest
Re: Not standard
« Reply #3 on: March 03, 2015, 05:01:10 AM »
Hi Aurel,

I have tried numerous permutations of ShellExecute using awinh.inc with gxo2.exe and co2.exe, and they all work as expected.

I suspect your file-paths and working directory may be causing the problem, or possibly some corruption of strings in your code.

A few of my tests:

Code: OxygenBasic
  1. sys WndProc
  2. include "$\ProjectsB\Scintilla\awinh.inc"
  3. ShellExecute 0,"open", "gxo2.exe", ""+"t.o2bas", ".\",0
  4.  

Code: OxygenBasic
  1. sys WndProc
  2. include "$\ProjectsB\Scintilla\awinh.inc"
  3. ShellExecute 0,"open", "gxo2.exe", "-c"+"t.o2bas", ".\",0
  4.  

Code: OxygenBasic
  1. sys WndProc
  2. include "$\ProjectsB\Scintilla\awinh.inc"
  3. ShellExecute 0,"open", "gxo2.exe", "-c "+"t.o2bas", ".\",0
  4.  


PS:

Ruben2 is working again! Tested with a few programs like StarFlower.RUB

So null characters in Oxygen's space() function may have caused problems!
« Last Edit: March 03, 2015, 05:27:01 AM by Charles Pegge »

Aurel

  • Guest
Re: Not standard
« Reply #4 on: March 03, 2015, 01:56:49 PM »
hi Charles
As you know ASciEdit (AScio2) is written in oxygen ,
and you say that you can compile ruben with latest release  ::)
ok i will try...hmmm


Charles
Space() is used in ruben in just one place :
Code: [Select]
'------ FILL GLOBAL STRING ARRAY ------------------------------
SUB FillArray
INT Lpos
INT LLen
bstring LText=""
string pText=""

For Lpos = 0 TO LCount
LLen = SendMessage richedit1, EM_LINELENGTH,Lpos, 0 ' not important
'print "LineLen;" + Str(LLen)
pText = Space (255)  ' it use 255 without error
SendMessage richedit1,EM_GETLINE,Lpos,strptr(pText)

'convert to bstring & show line in edit control
LText = pText
LText = Trim(LText)
'src[Lpos]=LText
lines[Lpos]=Ltext
 'print "LINE: " + lines[LPos]
LText=""

Next
'array filed
'MsgBox "GLOBAL Array filled...","OK!"
End SUB

and compiler don't complain about any error and i don't see any error
everything is created on very usual way..
ahh well most of rub examples crush
even worst thing i have with windows messages..
« Last Edit: March 03, 2015, 02:11:12 PM by Aurel »