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

This forum is meant for questions and discussions about the X# language and tools
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

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

Post 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
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

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

Post 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
CharlieDenver
Posts: 9
Joined: Thu Apr 18, 2019 9:16 am

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

Post by CharlieDenver »

This is looking really interesting, very keen to follow this thread :) :) :)
Attachments
TestxSharp1.png
TestxSharp1.png (86.82 KiB) Viewed 466 times
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

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

Post 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
FoxProMatt

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

Post 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
CharlieDenver
Posts: 9
Joined: Thu Apr 18, 2019 9:16 am

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

Post 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
FoxProMatt

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

Post by FoxProMatt »

Charlie - see reply #2 on this thread from Robert about XSI.exe
CharlieDenver
Posts: 9
Joined: Thu Apr 18, 2019 9:16 am

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

Post 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 ?
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

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

Post 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
Post Reply