Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Members: Macs vs Functions
#1
In trying to make many of the operations in a large marcro more generic by placing them into functions (so I can use them more easily elsewhere in the code and in other related macros), I keep running into the "Unknown Member" error. I get this on such common operations as .from(...) and .dospath(...)

If I move this code to the macro they work fine, but in function I get the error.

Function MurFTP_OpenLame
Code:
Copy      Help
function $inputf [$outputf]
;2 arguments: [inputfile] and [outputfile] lame req's dospath

if(getopt(nargs) < 2) ;; if no output path/filename specified, uses same as inputfile
,str s1.getpath(inputf)  ;; gets path only
,str s2.getfilename(inputf)  ;;gets input filename no ext
,outputf.from(s1 s2 ".mp3")
,
inputf.dospath(inputf)
outputf.dospath(outputf)

str lameexe = "c:\lame.exe" ;; for forum example, proper location declared earlier in actual mac

lamestring.from(lameexe " " inputf " " outputf " -b 128""''")

system lamestring
#2
.function(...) can be used only with str.
inputf and outputf are not str.
$ is lpstr.
~ is str.

use
function str'inputf
or
function ~inputf
or
function str&inputf
or
function ~&inputf
or
function $inputf
str s3=inputf
sr.function(...)
#3
Ahh, of course..thanks for setting me straight.


Forum Jump:


Users browsing this thread: 1 Guest(s)