Setting a Path using variables.

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
Anonymous

Setting a Path using variables.

Post by Anonymous »

Local cInvPath
cInvPath := WorkDir()

Eg Set Path cInvPath
Eg SetPath( cInvPath)

Etc.

Is it possible? If so, how please.
FFF
Posts: 1589
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Setting a Path using variables.

Post by FFF »

Do you never try?
Xide: New X#-runtime app
Function Start
LOCAL cInvPath
? cInvPath := WorkDir()
//Set Path cInvPath
SetPath( cInvPath)
RETURN
Compiles and runs.
What do you want to achieve?
As Robert wrote, we have no crystal-ball here to deduct your wishes...
Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
BiggyRat

Setting a Path using variables.

Post by BiggyRat »

In VO does it Karl? It won't work for me. It compiles ok, but the result is:

CWORKDIR; (CWORKDIR + "DB"); (CWORKDIR + "INVOICES"); (CWORKDIR + "RPT")

Code is (no Crystal ball required I wouldn't have thought, particularly as I gave it in the initial post) ...
LOcal cWorkDir
cWorkDir := WorkDir()
Set Path to cWorkDir, (cWorkDir + "Db"), (cWorkDir + "Invoices"), (cWorkDir + "Rpt")

Obviously, I would have thought, I want to Set the path for the app. Wasn't all that spelt out?
BiggyRat

Setting a Path using variables.

Post by BiggyRat »

Seems this code did the trick:

SetPath((cWorkDir + "Db") + "; " +(cWorkDir + "Invoices") + "; " + (cWorkDir + "Rpt"))

which gives me using GetCurPath()

C:cavo28BinDb; C:cavo28BinInvoices; C:cavo28BinRpt
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Setting a Path using variables.

Post by lumberjack »

Jeff,
BiggyRat wrote:In VO does it Karl? It won't work for me. It compiles ok, but the result is:
CWORKDIR; (CWORKDIR + "DB"); (CWORKDIR + "INVOICES"); (CWORKDIR + "RPT")
Code is (no Crystal ball required I wouldn't have thought, particularly as I gave it in the initial post) ...

Code: Select all

LOcal cWorkDir
cWorkDir := WorkDir()
Set Path to cWorkDir, (cWorkDir  + "Db"), (cWorkDir + "Invoices"), (cWorkDir + "Rpt")
Obviously, I would have thought, I want to Set the path for the app. Wasn't all that spelt out?
I am not trying to bash you here, but please for future reference. Are you using VO 2.8 or are you trying to do this with X#?
Assuming you working with X#, please remember, not all "commands" are available out the box. Have a look at XSharpDefs.xh, that are the commands currently implemented.

Having said that, if you want X# to understand your "set path to", just edit the XSharpDefs.xh in the X# include folder to include the following:

Code: Select all

#command SET PATH TO <*path*> => SETPATH(<(path)>:Replace(",", ";"))
You could also learn a new .NET feature while we at it, no worries about including "", or ending with "":

Code: Select all

Path.Combine(cWorkDir, "Db")
Path.Combine(cWorkDir, "Invoices")
Path.Combine(cWorkDir, "Rpt")
HTH,
______________________
Johan Nel
Boshof, South Africa
BiggyRat

Setting a Path using variables.

Post by BiggyRat »

I understand you're not trying to bash me Johan lol. It's just that I post in the VO NG, and get chided for that "No one reads it here, you must post it in the XSharp forum" So I post it in the X# forum, under the VO and Vulcan section, so to me it's obvious its VO I'm running, otherwise I'd be posting in the X# forum here wouldn't I?

Sorry if it sounds harsh, but I'm not having a great time atm, So my patience isn't what it usually is.

Having said that, the RPT folder now seems pointless as no matter what I try, if the RPT isn't in the root folder, it isn't found apparently. I was just trying to get things tidy.So failing that, I moved the rpt files back to the root folder...


And... Just for the record IF I write any further programs, I WILL use X#, but NOT until DBFCDX support is implemented. It's going to be a big enough learning curve for me as I don't do this stuff day in day out like you guys (though I'd like to), without learning new SEEK/ORDER/FOR/WHILE etc etc conditions I find the whole idea of an Index "Bag" much better and neater.
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Setting a Path using variables.

Post by lumberjack »

Hi Jeff,
BiggyRat wrote:It's just that I post in the VO NG, and get chided for that "No one reads it here, you must post it in the XSharp forum" So I post it in the X# forum, under the VO and Vulcan section, so to me it's obvious its VO I'm running, otherwise I'd be posting in the X# forum here wouldn't I?
Well, sometimes our assumptions are incorrect. I "assumed" you trying to make VO code run in X#... :lol: Ok, I will make a mental note.
Sorry if it sounds harsh, but I'm not having a great time atm, So my patience isn't what it usually is.
Well, hopefully that also explain why it might seem our patience with you also went out the backdoor...
Having said that, the RPT folder now seems pointless as no matter what I try, if the RPT isn't in the root folder, it isn't found apparently. I was just trying to get things tidy.So failing that, I moved the rpt files back to the root folder...
I have lost track about the original question. If you want to keep it out the forum, send me a private mail and I will try and assist getting your paths sorted out. The spaghetti style of the forums don't help...
And... Just for the record IF I write any further programs, I WILL use X#, but NOT until DBFCDX support is implemented. It's going to be a big enough learning curve for me as I don't do this stuff day in day out like you guys (though I'd like to), without learning new SEEK/ORDER/FOR/WHILE etc etc conditions I find the whole idea of an Index "Bag" much better and neater.
It seems DBFCDX will soon be implemented, so we would gladly accept you in the X# community (not that you should feel excluded).

Maybe just start your Subject with "VO 2.8" etc. It might already help putting us in the correct frame of mind.
______________________
Johan Nel
Boshof, South Africa
User avatar
robert
Posts: 4551
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Setting a Path using variables.

Post by robert »

Johan,
I agree with Jeff: there is no need for a VO Prefix for a message subject when that message is posted in the VO forum.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Setting a Path using variables.

Post by lumberjack »

Hi Robert,
robert wrote:Johan,
I agree with Jeff: there is no need for a VO Prefix for a message subject when that message is posted in the VO forum.
Point taken, sorry just sometimes due to speed trying to answer, one loose track of the Forum the message is posted in. It is a bit of spaghetti postings, compared to NNTP formatting...
______________________
Johan Nel
Boshof, South Africa
FFF
Posts: 1589
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Setting a Path using variables.

Post by FFF »

Nevertheless, Jeff, you might get better support if your questions are complete... Especially, you can't expect anyone to connect a "case" over different topics.
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Post Reply