I am having problems converting a bit of script code into a global function.
** The Script Segment: **
pname = a5.get_path()+chr(92)+"bitmaps"+chr(92)+"sqn"+chr(92)
parentform:bitmapsqn.bitmap.filename=pname+"null.bmp"
if alltrim(sqn_file.value) = "" then
goto nofile
end if
fname=pname+ut(sqn_file.value)+".bmp"
if file.exists(fname) then
parentform:bitmapsqn.bitmap.filename=fname
parentform:bitmapsqn.refresh()
goto donesqn
end if
nofile:
parentform:bitmapsqn.bitmap.filename=pname+"null.bmp"
done:
end
** The Global Function: **
function Get_Bmp as N(path as C)
pname = a5.get_path()+chr(92)+"bitmaps"+chr(92)+path+chr(92)
eval("parentform:bitmap"+path+".bitmap.filename="+chr(34)+pname+"null.bmp"+chr(34))
if alltrim(eval(path+"_file.value")) = "" then
goto nofile
end if
fname=pname+eval("ut("+path+"_file.value)")+".bmp"
if file.exists(fname) then
eval("parentform:bitmap"+path+".bitmap.filename=fname")
goto done
end if
nofile:
eval("parentform:bitmap"+path+".bitmap.filename="+pname+"null.bmp")
eval("parentform:bitmap"+path+".refresh()")
done:
end function
I get error "Parentform:bitmapsqn not found" even though it is on the test form that calls the function. I need to use some kind of alias like "Parentform" as I need to use this function on various forms for various bitmap files.
Just what am I doing wrong?
TIA
** The Script Segment: **
pname = a5.get_path()+chr(92)+"bitmaps"+chr(92)+"sqn"+chr(92)
parentform:bitmapsqn.bitmap.filename=pname+"null.bmp"
if alltrim(sqn_file.value) = "" then
goto nofile
end if
fname=pname+ut(sqn_file.value)+".bmp"
if file.exists(fname) then
parentform:bitmapsqn.bitmap.filename=fname
parentform:bitmapsqn.refresh()
goto donesqn
end if
nofile:
parentform:bitmapsqn.bitmap.filename=pname+"null.bmp"
done:
end
** The Global Function: **
function Get_Bmp as N(path as C)
pname = a5.get_path()+chr(92)+"bitmaps"+chr(92)+path+chr(92)
eval("parentform:bitmap"+path+".bitmap.filename="+chr(34)+pname+"null.bmp"+chr(34))
if alltrim(eval(path+"_file.value")) = "" then
goto nofile
end if
fname=pname+eval("ut("+path+"_file.value)")+".bmp"
if file.exists(fname) then
eval("parentform:bitmap"+path+".bitmap.filename=fname")
goto done
end if
nofile:
eval("parentform:bitmap"+path+".bitmap.filename="+pname+"null.bmp")
eval("parentform:bitmap"+path+".refresh()")
done:
end function
I get error "Parentform:bitmapsqn not found" even though it is on the test form that calls the function. I need to use some kind of alias like "Parentform" as I need to use this function on various forms for various bitmap files.
Just what am I doing wrong?
TIA
Comment