Page 1 of 1
Setting a Path using variables.
Posted: Sun Apr 21, 2019 1:30 pm
by Anonymous
Local cInvPath
cInvPath := WorkDir()
Eg Set Path cInvPath
Eg SetPath( cInvPath)
Etc.
Is it possible? If so, how please.
Setting a Path using variables.
Posted: Sun Apr 21, 2019 7:46 pm
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
Setting a Path using variables.
Posted: Mon Apr 22, 2019 12:36 am
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?
Setting a Path using variables.
Posted: Mon Apr 22, 2019 1:24 am
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
Setting a Path using variables.
Posted: Mon Apr 22, 2019 4:31 am
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,
Setting a Path using variables.
Posted: Mon Apr 22, 2019 5:01 am
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.
Setting a Path using variables.
Posted: Mon Apr 22, 2019 5:26 am
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#...
![Laughing :lol:](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_lol.gif)
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.
Setting a Path using variables.
Posted: Mon Apr 22, 2019 7:53 am
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
Setting a Path using variables.
Posted: Wed Apr 24, 2019 2:22 am
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...
Setting a Path using variables.
Posted: Wed Apr 24, 2019 7:01 am
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.