|
From: creedon <icr...@us...> - 2005-10-05 17:24:08
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/string In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25047 Modified Files: popFileFromAddress Log Message: removed uneeded local i tweaked formatting added flDropRootDot parameter, if true and address is in root database and begins with "root.", drop it Index: popFileFromAddress =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/string/popFileFromAddress,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** popFileFromAddress 26 Mar 2005 19:43:34 -0000 1.1.1.1 --- popFileFromAddress 5 Oct 2005 17:24:00 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.string.popFileFromAddress ! on popFileFromAddress (adr) { ÇPop the leading file path from an address. Return a string. The string can be coerced back to an address. ÇGiven an address to an item in a guest database, return the address as a string. Ç@["C:\\Frontier\\Guest Databases\\apps\\mainResponder.root"].mainResponder.discuss.readMessage returns mainResponder.discuss.readMessage. ÇIf the address is not to an item inside a guest database, but to a guest database, return a string version of the address. Don't pop the file path so the string can still be coerced back to an address. Ç@["C:\\Frontier\\Guest Databases\\apps\\mainResponder.root"] returns ["C:\\Frontier\\Guest Databases\\apps\\mainResponder.root"]. ÇIf the address is to an item in Frontier.root, return a string version of the address. Ç@websites.samples returns websites.samples. Ç10/11/99; 3:04:30 PM by PBS if table.inGuestDatabase (adr) { //it's a guest database address local (addressList = string.parseAddress (adr)); if sizeOf (addressList) == 1 { //the address is not in a guest database, but to a guest database return (string (adr))}; local (i, s = string (adr)); s = string.delete (s, 1, sizeOf (addressList [1])); local (ix = string.patternMatch ("\"].", s)); //there are probably additional characters if ix > 0 { s = string.delete (s, 1, ix + 2)}; return (s)} else { //it's an address to an object in Frontier.root return (string (adr))}} //if it's not in a guest database, return the string version of this address \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.string.popFileFromAddress ! on popFileFromAddress (adr, flDropRootDot = false) { ÇChanges Ç10/4/05; 11:36:55 AM by TAC Çremoved uneeded local i Çtweaked formatting Çadded flDropRootDot parameter, if true and address is in root database and begins with "root.", drop it Ç10/11/99; 3:04:30 PM by PBS ÇPop the leading file path from an address. Return a string. The string can be coerced back to an address. ÇGiven an address to an item in a guest database, return the address as a string. Ç@["C:\\Frontier\\Guest Databases\\apps\\mainResponder.root"].mainResponder.discuss.readMessage returns mainResponder.discuss.readMessage. ÇIf the address is not to an item inside a guest database, but to a guest database, return a string version of the address. Don't pop the file path so the string can still be coerced back to an address. Ç@["C:\\Frontier\\Guest Databases\\apps\\mainResponder.root"] returns ["C:\\Frontier\\Guest Databases\\apps\\mainResponder.root"]. ÇIf the address is to an item in Frontier.root, return a string version of the address. Ç@websites.samples returns websites.samples. local (s); if table.inGuestDatabase (adr) { // it's a guest database address local (addressList = string.parseAddress (adr)); if sizeOf (addressList) == 1 { // the address is not in a guest database, but to a guest database return (string (adr))}; s = string (adr); s = string.delete (s, 1, sizeOf (addressList [1])); local (ix = string.patternMatch ("\"].", s)); // there are probably additional characters if ix > 0 { s = string.delete (s, 1, ix + 2)}; return (s)} else { // it's an address to an object in Frontier.root s = string (adr); if s beginsWith "root." { s = string.delete (s, 1, 5)}; return (s)}} // if it's not in a guest database, return the string version of this address \ No newline at end of file |