News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

String function MKS$(x) not working...

Started by jym_fr, March 08, 2009, 01:06:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jym_fr

for j= 1 to...
fname$ = MKS$(j)
fic$ = "C:\TMP\BMP\" + fname$ + ".bmp"

I get an empty string, and fic$ = C:\TMP\BMP\.bmp

What's wrong ?
Thanks

Mark Laing


try this, maybe?
-------------------------------------------
sys (800) = 01
for j= 1 to 3
fname$ = j
fic$="C:\TMP\BMP\"+fname1$+".bmp"
message fic$
next j

'I get an empty string, and fic$ = C:\TMP\BMP\.bmp
'
'What's wrong ?
'Thanks
----------------------------------------------------

search this forum for 'mks' and you'll find a post explaining what mks really does.

dcadRob

This strips trailing zeros and periods automatically:

for j=1 to  ...

format fname$,"%d",j

fic$="C:\TMP\BMP\" + fname$ + ".bmp"

next j

Instead of "%d" you can try "%08d" which will right justify the number and fill the left with zeros for a total length of 8 characters (ie. 00000025.bmp).

jym_fr

Thank you Rob & Mark, both suggestions work !...