No Command(0) for dynamic lib ?

General FreeBASIC programming questions.
D.J.Peters
Posts: 8189
Joined: May 28, 2005 3:28
Contact:

No Command(0) for dynamic lib ?

Postby D.J.Peters » Jul 22, 2016 4:10

Since Command(0) does not return the dynamic lib name "libMyPlugin.so" or "MyPlugin.dll" ?

I'm sure years ago (V ~0.15)
fbc -dll MyPlugin.bas
command(0) returned the name of the library.
(or it was only a dream)

Joshy
MrSwiss
Posts: 3635
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: No Command(0) for dynamic lib ?

Postby MrSwiss » Jul 26, 2016 16:22

@Joshy

I, personally, don't go back longer than Ver. 0.24.0 but:
D.J.Peters wrote:fbc -dll MyPlugin.bas
command(0) = "fbc(.exe)", command(1) = "-dll", command(2) = "MyPlugin.bas" ... etc. ???
Since 'blanks' are used as 'separators', on command line, AFAIK.
D.J.Peters
Posts: 8189
Joined: May 28, 2005 3:28
Contact:

Re: No Command(0) for dynamic lib ?

Postby D.J.Peters » Jul 26, 2016 20:04

If stuff was build as dynamic lib *.dll or *.so not static *.a
command(0) returned inside the library "thename.dll" or "libthename.so"

but again may be it was only in my world :-)

Joshy
fxm
Posts: 9993
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: No Command(0) for dynamic lib ?

Postby fxm » Jul 26, 2016 20:46

With fbc version 0.15, Command(0) from a dll returns an empty string.

Code: Select all

' mylib.bas

Function Command0 () As String Export
  Return "'" & Command(0) & "'"
End Function

Code: Select all

' mytest.bas

#inclib "mylib"
Declare Function Command0() As String

Print Command0()

Sleep
Compiled with fbc 0.15:

Code: Select all

''
adele
Posts: 47
Joined: Jun 13, 2015 19:33

Re: No Command(0) for dynamic lib ?

Postby adele » Jul 26, 2016 21:19

Hi Joshy,

D.J.Peters wrote:If [...] command(0) returned "thename.dll" or "libthename.so"


if you just want the DLL to tell you her name, I would try somewhere in the code

Code: Select all

  VAR myName=__FILE__

and provide a function for the answer.

Adi

Return to “General”

Who is online

Users browsing this forum: Google [Bot] and 17 guests