decodeResourceURL runtime error

Hi,

Does someone can explain me with the following code raises a runtime error ?

string theURL = "doors://VM_IBM:36677/?version=2&prodID=0&urn=urn:telelogic::1-4a6d660710df0c40-F-0000a8a2"//A DOORS Folder

string protocol = null

string dbHost = null

int dbPort = null

string repositoryId = null

string dbName = null

string dbId = null

Item theIt = null

ModuleVersion theModVer = null

string viewName = null

int objectAbsno = null

 

string errmsg = decodeResourceURL(theURL, protocol, dbHost, dbPort, repositoryId, dbName, dbId, theIt, theModVer, viewName, objectAbsno)

print errmsg

Thanks for any help.

Joseph


jaracic - Wed Jun 04 08:59:57 EDT 2014

Re: decodeResourceURL runtime error
llandale - Wed Jun 04 09:38:51 EDT 2014

The string in variable "theURL" is in the format of a "URL", not of a "ResourceURL".  Run the following code from a folder to see what I mean:

  • Folder fCurr = current
  • print "a 'URL'\t\tlooks like: \t"             (getURL(fCurr)) "\n"
  • print "a 'ResourceURL'\tlooks like: \t" (getResourceURL(fCurr)) "\n"

So in your code, match up "getURL()" with "decodeURL()", and match up "getResourceURL()" with "decodeResourceURL()".

What is the real difference?  I have no idea at all.

-Louie

And it seems surround your "decode" statement wiith noError() and lastError():

  • noError()
  • decode...
  • string ErrMess = lastError()
  • if (!null ErrMess) then the decode didn't work

Re: decodeResourceURL runtime error
jaracic - Wed Jun 04 09:47:20 EDT 2014

llandale - Wed Jun 04 09:38:51 EDT 2014

The string in variable "theURL" is in the format of a "URL", not of a "ResourceURL".  Run the following code from a folder to see what I mean:

  • Folder fCurr = current
  • print "a 'URL'\t\tlooks like: \t"             (getURL(fCurr)) "\n"
  • print "a 'ResourceURL'\tlooks like: \t" (getResourceURL(fCurr)) "\n"

So in your code, match up "getURL()" with "decodeURL()", and match up "getResourceURL()" with "decodeResourceURL()".

What is the real difference?  I have no idea at all.

-Louie

And it seems surround your "decode" statement wiith noError() and lastError():

  • noError()
  • decode...
  • string ErrMess = lastError()
  • if (!null ErrMess) then the decode didn't work

Many thanks ! 

I missed this function ;-)