xsharp.eu • Command Window or Immediate Window in XIDE or Visual Studio??? - Page 2
Page 2 of 3

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Wed Apr 24, 2019 8:15 am
by Karl-Heinz
robert wrote:Karl Heinz,
You can omit the aa := and replace that with STATIC
Then you don't need to prefix the function names
Hi Robert,

thanks, now it works. But there´s a very strange problem with the lower/upper case of the word "Functions" ?

Code: Select all

#R "XSharp.Core"

USING STATIC XSharp.Core.Functions  //  Upper() isn ´t recognized later ??
USING STATIC XSharp.Core.FunCTionS  // ok !
USING STATIC XSharp.Core.functions  // ok !

Upper ( "aaaa" )


regards
Karl-Heinz

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Wed Apr 24, 2019 8:19 am
by robert
Karl Heinz,
Dit you enter

Code: Select all

USING XSharp.Core.Functions

first and then corrected it to

Code: Select all

USING STATIC XSharp.Core.Functions


In that case I can explain that.

Robert

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Wed Apr 24, 2019 9:42 am
by Karl-Heinz
robert wrote:Karl Heinz,
Dit you enter

Code: Select all

USING XSharp.Core.Functions

first and then corrected it to

Code: Select all

USING STATIC XSharp.Core.Functions
Hi Robert,

tried that, but it makes no difference. As long i´m using exactly "Functions" and not something else like "functions" or "FUNCtions" , Upper() isn´t recognized.

Let's wait until Matt is back again. Maybe his keyboard handling is better than mine ;-)

regards
Karl-Heinz

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Thu Apr 25, 2019 5:16 pm
by CharlieDenver
This is looking really interesting, very keen to follow this thread :) :) :)

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Thu Apr 25, 2019 6:22 pm
by Karl-Heinz
CharlieDenver wrote:This is looking really interesting, very keen to follow this thread :) :) :)
Hi Phillip ,

it's getting even better ;-)

All you need is a *standard* DBF to run the script, because currently your dbf may *not* contain any VFP specific fieldtypes ! Simply change the path and the name of the DBF.

xDBF.prgx

Code: Select all


#R "XSharp.Core"
#R "XSharp.RT"
#R "XSharp.VO"


USING STATIC xSharp.Core.functions
USING STATIC xSharp.RT.functions
USING STATIC xSharp.VO.functions


if dbusearea ( TRUE , "DBFNTX", "D:Testtext.dbf" )

	? "list content of Field no. 1"
	? "---------------------------"
	?

	do while ! eof()

   		? Fieldget ( 1 ) 

   		dbskip (1)

	enddo 

else

 ? "can´t open DBF"

endif 

DBCloseAll()

?
?

Console.WriteLine ("press any key" ) 
Console.Read()  




regards
Karl-Heinz

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Fri Apr 26, 2019 9:16 am
by FoxProMatt
@Karl-Heinz said:
Let's wait until Matt is back again. Maybe his keyboard handling is better than mine
Indeed, I found that Upper() only works if I use "functions" and not "Functions".
This is true for both XSharp.Core.funcitons and XSharp.RT.functions.

This works:

Code: Select all

#R "C:Program Files (x86)XSharpAssembliesXSharp.Core.dll"
#R "C:Program Files (x86)XSharpAssembliesXSharp.RT.dll"

USING STATIC xSharp.Core.functions
USING STATIC xSharp.RT.functions

This does NOT work:

Code: Select all

#R "C:Program Files (x86)XSharpAssembliesXSharp.Core.dll"
#R "C:Program Files (x86)XSharpAssembliesXSharp.RT.dll"

USING STATIC xSharp.Core.Functions
USING STATIC xSharp.RT.Functions

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Fri Apr 26, 2019 12:21 pm
by CharlieDenver
Hi Karl
I tried running this in XIDE and get an error
error XS9002: Parser: mismatched input '#R'
Please can you let me know where you are running the prg
RE xDBF.prgx above

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Fri Apr 26, 2019 12:33 pm
by FoxProMatt
Charlie - see reply #2 on this thread from Robert about XSI.exe

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Fri Apr 26, 2019 12:44 pm
by CharlieDenver
Hi Matt
I'm OK with XSI, I've been running that OK
I was asking about the example code listed by Karl above (xDBF.prgx)
Can I run that code inside of VS or XIDE ?

Command Window or Immediate Window in XIDE or Visual Studio???

Posted: Fri Apr 26, 2019 1:55 pm
by Karl-Heinz
CharlieDenver wrote:Hi Matt
I'm OK with XSI, I've been running that OK
I was asking about the example code listed by Karl above (xDBF.prgx)
Can I run that code inside of VS or XIDE ?
Hi Phillip,

The default app for *.prgx script files is the X# interpreter xsi.exe. Open Notepad, insert my posted code, change the path and filename to a existing DBF and save the content as xDBF.prgx . Then double click in the explorer the file xDBF.prgx

Again: only select a DBF that doesn´t use any VFP specific field types !

regards
Karl-Heinz