Author Topic: Save file as...  (Read 19324 times)

0 Members and 1 Guest are viewing this topic.

Offline NicarTopic starter

  • Full Member
  • ***
  • Posts: 198
  • Activity:
    0%
  • Reputation Power: 0
  • Nicar has no influence.
  • Respect: +20
  • Referrals: 0
    • View Profile
Save file as...
« on: July 07, 2008, 12:35:15 PM »
0
Ok, I went to save what was my UOC's Recall Lumber.... I chose save as, and did Nics Recall Lumberjacking v2.j4.0 .  Then I was trying to upload to WinUO. I noticed searching for it, it didn't keep the txt extension, which I came out to find was true, even though it was selected and all when I did save as. So, well, to get around this, I opened in EUO and saved as and it worked. So, not sure if save as is broken like that.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Save file as...
« Reply #1 on: July 07, 2008, 12:41:53 PM »
0
There is an issue with the save as function where you do a save as, but it doesn't sense you've saved, but it has anyhow.  So I'm not sure I understand what you saw.  Did it just not save the file at all, or did it save to the old file name?
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Save file as...
« Reply #2 on: July 07, 2008, 12:45:19 PM »
0
Oh, perhaps that EUO is an option for the save window.  It's an option for the load file gump, but I guess I missed it with the save.  If that's the problem then that's an uber easy fix and a silly omission on my part.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline NicarTopic starter

  • Full Member
  • ***
  • Posts: 198
  • Activity:
    0%
  • Reputation Power: 0
  • Nicar has no influence.
  • Respect: +20
  • Referrals: 0
    • View Profile
Re: Save file as...
« Reply #3 on: July 08, 2008, 03:48:19 AM »
0
It saved as... or so it looked like, the file type it gave it was a   "0 file type"   I kept on wondering why when I tried to upload it to WinUO, why it told me invalid file name. So, than, I dumped it into EUO (program) and saved as my txt file. I know you have txt, suo and euo extension, I tried to save as a txt and it gave a 0 file type.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Save file as...
« Reply #4 on: July 08, 2008, 06:10:10 AM »
0
Did you start out as a different filetype?  I cannot reproduce this one.

Edit:  never mind, I see what you are talking about.  Hmm, all that is handled with the system dialog so I'm not sure what's up with that.  I'll check, though.
« Last Edit: July 08, 2008, 06:15:56 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Save file as...
« Reply #5 on: July 08, 2008, 06:46:04 AM »
0
Ok, I see what's up.  It's a quick fix on my end, but really the code is doing what it's supposed to.  If you need to change the extension, all you have to do is type it in by hand instead of relying on the dropdown box in the Save As dialog.  That'll let you save it to whatever extension you want.

The only time the dialog adds its own extension is when you don't have a extension in the filename already.  so when you save a "blank" script, the extension is added because you don't currently have one.  You can force it but changing it by hand, though.

For me, I can just strip the extension off, but then that takes away the assumption that the extension you already have is what you will always want.  So I'm almost inclined to leave it as it is...
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Xclio

  • Officially "The MAN"
  • Elite
  • *
  • *
  • Posts: 981
  • Activity:
    0%
  • Reputation Power: 9
  • Xclio has no influence.
  • Gender: Male
  • Respect: +56
  • Referrals: 1
    • View Profile
Re: Save file as...
« Reply #6 on: July 08, 2008, 09:57:04 AM »
0
I ran into this as well and it seems to be with the version that we use.  It was wierd though as I was able to save as version 1.2 but version 1.21 wouldn't save properly.  This is using the save as function and also I was using SUO build 186, I noticed that you have 187 available and I will test it out there to see if I get the same result.

Offline Xclio

  • Officially "The MAN"
  • Elite
  • *
  • *
  • Posts: 981
  • Activity:
    0%
  • Reputation Power: 9
  • Xclio has no influence.
  • Gender: Male
  • Respect: +56
  • Referrals: 1
    • View Profile
Re: Save file as...
« Reply #7 on: July 08, 2008, 10:08:45 AM »
0
Okay pulled up build 187 and did some testing.  Same result except I found something a bit different but the same.  I will try and explain.

Opened up version 1.2 of my rail tamer and performed a save as.  Renamed it from Xclio's Taming on Rails v1.2 to the new name of Xclio's Taming on Rails v1.22 with the below option for .txt selected.  This saved the file but instead of it being a .txt file it saved it as a .22 file thus taking the .22 of my version number and creating a new file extension.

So in some further testing I did a save as of Xclio's Taming on Rails v1.2 but didn't rename it.  This saved properly as a .txt file extension.

Finally I did a save as of Xclio's Taming on Rails v1.2 and renamed it to test v1.2 and it failed.  This time saving improperly as a .2 file extension instead of a .txt file extension.

Presumeably it saved properly the second time without the rename because it recognized that the file was already there and simply replaced the data within the file thus never changing the file extension.  I did this test again but isntead renamed it to the name of one of myother files and confirmed this result.


TM as you said you believe that the code is working as intended which it probably is but I think if you compare it to the standard operation of a windows based system whatever is "selected" below will override anything that is typed enless a "valid" extension is typed above.  I am not sure how it cross checks to ensure that it is a valid extension (presumeably checking some sort of database).  Hopefully this makes sense to you.  Let me know if you need clarification on anything.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Save file as...
« Reply #8 on: July 08, 2008, 11:17:18 AM »
0
Yeh, I was being lazy this morning, sorry. 

I had hopes that the file handling control would do all that for me, but it turns out I have to determine what the extension is by hand and then strip it off so the control will then make the proper changes when you change the extension.  I did that this morning and things look pretty good now.

I'll have to check the instance where you have a "decimal" other than the one in the extension to see if it's handled correctly. I wasn't doing anything with that before, so if there's a bug in the way the control handles it, I'll have to fix the bug by avoiding the control's code which I can't change.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Xclio

  • Officially "The MAN"
  • Elite
  • *
  • *
  • Posts: 981
  • Activity:
    0%
  • Reputation Power: 9
  • Xclio has no influence.
  • Gender: Male
  • Respect: +56
  • Referrals: 1
    • View Profile
Re: Save file as...
« Reply #9 on: July 10, 2008, 06:29:47 AM »
0
Okay did some brief testing with the save as feature of build 189 and these were my results.

It seems to be defaulting just fine to whatever I have in the drop down box.  However I am experiencing some issues.

I created a new file and did a save as naming the file test and the drop down box selected to .txt, my result was that this worked just as expected.  I then did another save as this time naming it test v1.2 this resulted in another file named test .txt (the space is in the name now but no v1.2).  Again I did a save as this time naming it test v1.22 a file named test v.txt was created.

It seems to be lopping off the last 4 characters under any circumstance that it detects a period within the file name that you elect.  Further testing proved this when I named files as test v1.3333 and got test v1..txt (yes two periods as the first one is the name of the file while the second one is for the .txt extension).  Also named a file test v1.12345 and the result was a file saved as test v.1.1.txt

Again hopefully this makes sense to you.  But simply from what I can tell is that whenever a period is detected within the file name it chopps of the last 4 characters of the file name and then appends the file extension.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Save file as...
« Reply #10 on: July 10, 2008, 10:02:07 AM »
0
Unfortunately  it does make sense.  ;)

I took the poor-mans approach with the fix to the filename conversions, but it looks like I have to write a bit more code to do it properly.  I was lazy yesterday with that "fix".  It works for some instances, but not universally.  It's a frustrating thing because it's something you hope the file dialog will just DO for you, but unfortunately you still have to do all the legwork so on little function like that can generate a bunch of silly code.

But thank you for your thorough testing; I'll have more time this weekend to generate the needed code to fix it properly.  There just wasn't a fast fix for it, darn it.
« Last Edit: July 10, 2008, 10:24:24 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Xclio

  • Officially "The MAN"
  • Elite
  • *
  • *
  • Posts: 981
  • Activity:
    0%
  • Reputation Power: 9
  • Xclio has no influence.
  • Gender: Male
  • Respect: +56
  • Referrals: 1
    • View Profile
Re: Save file as...
« Reply #11 on: July 10, 2008, 10:27:49 AM »
0
Cool, well not really but at least you understood what I was trying to explain.  It can get kinda difficult to explain stuff like that somtimes.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Save file as...
« Reply #12 on: July 10, 2008, 10:34:01 AM »
0
Well, because of your testing, it was able to shine the light on exactly what crappy code I kludged in to "fix" that issue.  So your explanations were top-notch!
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline NicarTopic starter

  • Full Member
  • ***
  • Posts: 198
  • Activity:
    0%
  • Reputation Power: 0
  • Nicar has no influence.
  • Respect: +20
  • Referrals: 0
    • View Profile
Re: Save file as...
« Reply #13 on: July 11, 2008, 08:25:29 AM »
0
Well, just went through some the save as testing (SUO build 191) with at end of my file has v2.j4.0 or something.. changed a bit here and there, and each save as, when i checked what got saved, it had the correct file name, and the correct file extension.

I think Xclio for the help of having this make sense to TM and some extra testing and re-testing.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Save file as...
« Reply #14 on: July 11, 2008, 08:36:10 AM »
0
Well, just went through some the save as testing (SUO build 191) with at end of my file has v2.j4.0 or something.. changed a bit here and there, and each save as, when i checked what got saved, it had the correct file name, and the correct file extension.

I think Xclio for the help of having this make sense to TM and some extra testing and re-testing.

Good deal.  I'll be doing a bit of scripting this weekend trying to break it.  Oh, I enabled the auto-backup feature (not v191 however) of the text editor control; eventually I'll have that as one of the Config features.  There will be a bunch of those.  Rulers, space markers, tab markers, EOL markers, etc.

And yes, thanks Xclio and Nicar for the testing!
« Last Edit: July 11, 2008, 08:39:15 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: