Author Topic: SaveAs acts like Save  (Read 66 times)

Gymbo

  • Jr. Member
  • **
  • Posts: 88
SaveAs acts like Save
« on: June 13, 2019, 10:12:22 AM »
I have 2 macros that perform basically the same function, using >SaveAs works just fine with one but the other brings up the Save As file dialog.
Code: [Select]
>SaveAs
{
<Filename [fname$]
}

I traced the problem down to a PutAttr statement, the one that saves:
Code: [Select]
PutAttr j , 13, 0, 2and the that doesn't save:
Code: [Select]
PutAttr j , 13, 0, 2, 0, 0, 0, 0, 0
The first one, the one that saves the file, changes the color of the text to black, as does the second one, however when I change the second one like the first one, it saves the file but the text color stays the same, not black.

To make matters even more complicated both macros operate on different drawings.

Any ideas?
Regards,

Jim

Lar

  • Hero Member
  • *****
  • Posts: 2890
Re: SaveAs acts like Save
« Reply #1 on: June 13, 2019, 07:56:42 PM »

I thought the purpose of >SaveAs was to open the dialog box. Far as I know it even opens the dialog when you put a filename in the code.


When the SaveAs dialog opens it's usually because the filename is missing or invalid for the >Save command.  You have to make sure fname$ is being given a value, or if there is a folder in the filename it exists, or there are no invalid characters. Also, the filename usually has to end with a backslash.


When not running a macro, SaveAs always acts like Save when the file is being saved for the first time, meaning the dialog box opens.


When you say both macros operate on different drawings  do you mean they each only work properly on a certain drawing?


Lar

Gymbo

  • Jr. Member
  • **
  • Posts: 88
Re: SaveAs acts like Save
« Reply #2 on: June 14, 2019, 09:21:23 AM »

I thought the purpose of >SaveAs was to open the dialog box. Far as I know it even opens the dialog when you put a filename in the code.
Not in this case.

Quote
When the SaveAs dialog opens it's usually because the filename is missing or invalid for the >Save command.  You have to make sure fname$ is being given a value, or if there is a folder in the filename it exists, or there are no invalid characters. Also, the filename usually has to end with a backslash.


When you say both macros operate on different drawings  do you mean they each only work properly on a certain drawing?

Both macros were designed to work on their own drawing, they go through the drawing and replace letters with numbers, the first one replaces 16 letters while the second one replaces 19. I'm happy to share the drawings, the macros and the .txt files that hold the numbers.

These are based on some puzzles I saw in the fall issue of "Popular Science" magazine. They're kinda simple puzzles but fun for my grandkids.
Regards,

Jim

Lar

  • Hero Member
  • *****
  • Posts: 2890
Re: SaveAs acts like Save
« Reply #3 on: June 14, 2019, 12:19:25 PM »
Well, you have me curious now. Let's see the whole package. I think I downloaded one of the macros from another post (but it's gone now).

Gymbo

  • Jr. Member
  • **
  • Posts: 88
Re: SaveAs acts like Save
« Reply #4 on: June 14, 2019, 12:28:37 PM »
Ok, these macros are somewhat different from the one from the other post.
Regards,

Jim