Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

forum.gupta.bugreport (2005-2010)
NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 31 Jan 2008, 11:51

 Posted by:  Philip Hautekiet 

This function doesn't work :

Call
VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

All receive parameters remain null values

Any suggestions?

Thanks in Advance.

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 31 Jan 2008, 16:02

 Posted by:  Krzysztof Dorko 

Hi
I can only say: This function works
at least on GTD 4.2
And if I good remember on 1.51, 2.0, 4.0 and 4.1 I had similar "experience"
:)
But I think (it is what I observed) This function "does not work" if
strArgArray[0] is empty.
To resolve this you should save your project to app/apt file before you run
your test.

Hth
Kris

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 31 Jan 2008, 17:36

 Posted by:  Jeff Luther 

"Any suggestions?" - Yes! How about a small test case to show this?? And
what ver. of TD are you using?

These are ALWAYS good pieces of your puzzle to have; it enables us to
easily verify what you are finding (certainly much easier than having to
write something when you have already done this) and, more importantly,
assuming it does work for us, to help you figure out your next step
might be. And if we can verify the error you are finding, submitting
something to Unify would be your next step and they require a test case.

(I'll also tell you heard and seen myself: There have been many times
here on the NG when a small test case of something particular like your
issue actually works! This can at least give the hint that the issue is
different, bigger, than a simple "doesn't work.")

Best Regards,
Jeff @ PC Design
info. & samples: www.JeffLuther.net/unify/

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 01 Feb 2008, 14:52

 Posted by:  Philip Hautekiet 

Here the code in 1 sal function.
This function, called on SAM_AppStartup, sets some default global variables
which are the directories of files associated with the applications
(reports, bitmaps, ...).
I was surprised with the values of the recieive variables of the split
function.

We wrote this code to let the application work on citrix , etc.

Thanks to all who are involved.

!!CB!! 134
Function: PalGetProgLocaties
Description:
Returns
Parameters
String: sAppDir
.data INHERITPROPS
0000: 0100
.enddata
Static Variables
Local variables
String: sSplitDrive
String: sSplitDir
String: sSplitProg
String: sSplitExt
String: sInfSharedDir
Actions
Call
VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)
If sSplitDrive = STRING_Null
Set sSplitDrive = 'C:'
Set sInfSharedDir = VisDosGetEnvString('InfohosSharedDir')
If sInfSharedDir = STRING_Null
! Oude versie
If sSplitDir = STRING_Null
Set sDir = sSplitDrive || '\\infohos\\' || sAppDir || '\\'
Else
Set sDir = sSplitDrive || sSplitDir
Set sDirDb = sSplitDrive || '\\infohos\\db.inf'
Set sDirBitmap = sSplitDrive || '\\infohos\\bitm\\'
Set sDirInfohosBitm = sDirBitmap
Set sDirQrp = sDir
Else
! Nieuwe versie
If SalStrRightX(sInfSharedDir,1) != '\\'
Set sInfSharedDir = sInfSharedDir || '\\'
If sSplitDir = STRING_Null
Set sDir = sSplitDrive || '\\infohos\\' || sAppDir || '\\'
Else
Set sDir = sSplitDrive || sSplitDir
Set sDirDb = sInfSharedDir || 'db.inf'
Set sDirInfohosBitm = sInfSharedDir
Set sDirBitmap = sDir
Set sDirQrp = sDir
! Set sDirBitmap = sDir || 'Bitm\\'
! Set sDirQrp = sDir || 'Reports\\'

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 01 Feb 2008, 18:21

 Posted by:  Jeff Luther 

What I meant by 'test case' was a sample apt file that we could run to
verify what you are finding. The code below isn't of use; it is the
VisDosSplitPath() itself which you say is failing; your code below shows
what you are doing with the return vars from the call.

I've attached a snapshort of VTTEST's sample call to this function
showing that it, in fact, does work. Does the VTTEST version work for
you? Have you tried?

(I would ALWAYS use the sample VTTEST to learn more about the VT
functions and to test something that I feel does not work correctly.)

I can think of only 1 reason why your code below is failing:
strArgArray[0] is an empty string. Why that is, I don't know *without a
test case* to test with!!

- Jeff


Attachment: VisDosSplitPath.jpg

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 04 Feb 2008, 09:35

 Posted by:  Philip Hautekiet 

I've written this small 5.1 application to prove it doesn't work on our test
PC.

strArgArray is Ok, but the 4 receive parameters (dir,drive,base,ext) are
strange values.

Thanks in advance.

Attachment: screenshot.JPG
Attachment: visdossplitpath.txt

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 04 Feb 2008, 16:25

 Posted by:  Martin Duty 

I think what Jeff was suggesting was you upload the test program for us to
look at. We need the code on our systems so we can look through and figure
out what the actual problem is.

Martin

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 04 Feb 2008, 18:03

 Posted by:  Jeff Luther 

Martin is right, Philip. But in addition it looks like you are using TD
v5.1 and thus the problem looks to be a unicode issue.

If so, this should be posted to the Unify forum; they are not handling
v5.1 issues here. (If unicode, it 'should' work: the VIS functions
should know unicode and your fields should display it as well.)

Otherwise, send us that *application code* for your dialog box. That's
what we need.

- Jeff

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 05 Feb 2008, 07:32

 Posted by:  Philip Hautekiet 

Here is the code, thanks for your help.

Attachment: progloc.apt

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 05 Feb 2008, 11:44

 Posted by:  Philip Hautekiet 

Heidi Van Gele and Philip found the reason why it didn't work.

We had our own declaration of the external function VisDosSplitPath,
VisFilOpen, VisFileReadString.
Some parameters are different types now. (LPWSTR instead of LPSTR)

Our advice : only use the declarations of the vt.apl.

!!CB!! 145

Function: VisDosSplitPath

Description:

Export Ordinal: 28

Returns

Parameters

String: LPSTR

Receive String: LPHSTRING

Receive String: LPHSTRING

Receive String: LPHSTRING

Receive String: LPHSTRING

!!CB!! 145

Function: VisDosSplitPath

Description:

Export Ordinal: 28

Returns

Parameters

String: LPWSTR

Receive String: LPHSTRING

Receive String: LPHSTRING

Receive String: LPHSTRING

Receive String: LPHSTRING

NewsgroupServer
Robot
Robot
Posts: 116488
Joined: 24 Feb 2017, 12:00
Location: World wide

Call VisDosSplitPath(strArgArray[0],sSplitDrive,sSplitDir,sSplitProg,sSplitExt)

Post by NewsgroupServer » 05 Feb 2008, 17:26

 Posted by:  Jeff Luther 

Glad you found the problem!

"Our advice : only use the declarations of the vt.apl." - GOOD advise, too.

- Jeff

Return to “gupta.bugreport”

Who is online

Users browsing this forum: [Ccbot] and 0 guests