- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I must to open an executable program with a commandline so I'm using the instruction runqq(filename, commandline) but in 'commandline' I have a filname which is opened with an edit box(I can also use systemqq(commandline)). But the program doesn't function. Can you help me please?
My code is:
subroutine main
use dflib
include 'nomfic.inc' !(with variable fichie and command(character*30))
integer*2 res
integer*4 NCL
NCL=len_trim(FICHIE) !Fichie is the name I retrieve in the edit box(t: est)
command=FICHIE(:NCL)
res=runqq('multi ',command)
call exit()
end subroutine
but this code functions (I don't undersand):
subroutine main
use dflib
include 'nomfic.inc'
integer*2 res
integer*4 NCL
command='T:TEST'
res=runqq('multi ',command)
call exit()
end subroutine
I must to open an executable program with a commandline so I'm using the instruction runqq(filename, commandline) but in 'commandline' I have a filname which is opened with an edit box(I can also use systemqq(commandline)). But the program doesn't function. Can you help me please?
My code is:
subroutine main
use dflib
include 'nomfic.inc' !(with variable fichie and command(character*30))
integer*2 res
integer*4 NCL
NCL=len_trim(FICHIE) !Fichie is the name I retrieve in the edit box(t: est)
command=FICHIE(:NCL)
res=runqq('multi ',command)
call exit()
end subroutine
but this code functions (I don't undersand):
subroutine main
use dflib
include 'nomfic.inc'
integer*2 res
integer*4 NCL
command='T:TEST'
res=runqq('multi ',command)
call exit()
end subroutine
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
write your own runqq subroutine, call it both ways, and check the parameters:
subroutine runqq( p, q )
character p(*), q(*)
print *, 'p = "', TRIM(p), '"'
print *, 'q = "', TRIM(q), '"'
end
... likely one of them is getting messed up. Also it wouldnt hurt to print out "res".
subroutine runqq( p, q )
character p(*), q(*)
print *, 'p = "', TRIM(p), '"'
print *, 'q = "', TRIM(q), '"'
end
... likely one of them is getting messed up. Also it wouldnt hurt to print out "res".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does the string from the edit box have a null terminator? If so, try stripping it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It doesn't function, it's not a problem of size or reading because with the debugger the variable FICHIE is correctly reading 't:test'.
I tried with createprocess(), it functions with 't:test' but not with FICHIE. The problem come from FICHIE and i don't know why?
Is it a pointer or a target argument?and how using pointer and target?
Thank you.
I tried with createprocess(), it functions with 't:test' but not with FICHIE. The problem come from FICHIE and i don't know why?
Is it a pointer or a target argument?and how using pointer and target?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is most likely the contents of FICHIE contains a trailing NULL character.
Viewing FICHIE in a watch window will not show the null character. (Getting the address of FICHIE via LOC(FICHIE) and putting that addressin a Memory watch window would show the hex values of FICHIE including any trailing null)
In your original post viewing the value of NCL would show whether there were any trailing characters;that isNCL would be > 6
I did a quick test with the following
character(80) :: line
integer :: i
line = 't:test'//char(0) ! append a trailing null
i = len_trim(line)
gives "i" a value of 7 not 6 !
Les
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page