"save this stack" doesn't work in livecode - mobile

Once I could save an existing state in the application using the "save this stack" command, both on a computer and on a mobile device.
Today I found out, it no longer works.
For example: there is a field that is incremented by 1, and I reach 10.
If I leave the app and reopen it, it's not saved and will start from 0.
Why? How can this be fixed?
Code:
on mouseDown
add 1 to field "counter"
save this stack
end mouseDown

Make a new stack with a field and a button, and place this in the button script:
on mouseUp
add 1 to fld 1
save this stack
end mouseUp
If you click on the button, the field increments. If you then close the stack, it will shut down at once, not asking if you want to save it. If you then re-open, the last state of the field is displayed.
The reason you are not asked to save is because the stack was just saved, and no changes were made. The field holds the latest value. In other words, all is right with the world. The question then becomes this: what is different about your stack?
Mac os 10.9. LC 8.1.8. (But none of any of that should matter)

That's exactly what I did But it is not saved! I pressed and pressed And I got to 10. Then I closed the app and reopened it The field presented the first value (0 for this purpose) and not the value 10 * Not working on mobile

Desktop: I tried it on my IDE and it works! But only if you use is as livecode stack and not as standalone, see next section.
Mobile: You can not save changes in the main stack on mobile devices because it is always a standalone. Mainstacks in standalones cannot be chanched because they are part of the binary. If you want to have a stack on a mobile device (or desktop) which can save itself you have to create it as a substack.

To be correct, a substack, if also part of the executable file, cannot be saved.
The usual method is to attach one or more stack files to a "Splash" stack.
The Splash stack generally has limited functionality, such as to navigate to the working stack or stacks, and all their substacks. Those all can be saved. The splash stack is simply a vehicle to open the standalone, and then let its associated stacks do the real work.

Use
command saveThisStack
put fld "score" of cd "mainCard" into tTempList
put the base64Encode of tTempList into tTempList
set the defaultFolder to specialFolderPath("documents")
put tTempList into URL ("file:score.txt")
end saveThisStack

Related

How do I prevent VS Code from trying to save all unsaved files on hotkey save command and save only the current one?

I have a tendency to have multiple unsaved notes and code segments open intentionally in VS Code. I don't want to save them. This is just a holding place as I work on stuff and then I want it to go away.
Currently, when I go to save a new file I want to keep while have several others I don't want to keep, it goes through a list of all of them and tries to save them each one at a time. I don't want that. I just want to save the file in the current viewport.
The hotkey I use is Command + S (which is the default "Save" hotkey on Mac OS X). Note that in VS Code's menu, it states that the "Save All" hotkey is Option + Command + S.
Is there a way to have it ignore the other unsaved files when saving the current one?
I know this is too late, but it might help other people.
To save all files and don't want VS code to ask to save completely unsaved files, you can use the below keyboard shortcut.
File.Save All Files (workbench.action.files.saveFiles)
This will only save previously saved files.
Hope this helps.

Yakuake - remap split navigation away from Shift+Tab

Yakuake (KDE drop-down terminal) would be a very convenient tool for me, except for a single mysterious key mapping: Shift+Tab
What yakuake shortcut settings says it does: Nothing
What it actually does: Switches to previous terminal split
This is unfortunate, since it drowns the mapping from my vimrc to walk backwards up the autocomplete menu.
Does anyone know of a way to remap this elusive mapping? I checked in all the other KDE shortcut settings and found nothing. After all, I have no problems in Konsole...
Steps to reproduce this mysterious behaviour:
Open yakuake
hit Ctrl+( to create a split view
hit Shift+Tab
I am on yakuake 3.0.5+, and the rest of my system can be inspected here
It turns out this was a known bug:
https://bugs.kde.org/show_bug.cgi?id=421632
It should be fixed in the next KDE bugfix release (20.08).

Installshield 2011: Take path from one window, take text from second

Good day, everyone. I have that task assigned which consists in creating simple installscript-only project, that should have 2 windows: first will prompt user to enter a path and create text file in this specified location, while second will promt for text input and save anything user writes into this text file.
Funny point is that I have small installshield experience (completed tutorials... well, yeah, that's all) and very little programming experience on top of that. As far as i understand, I should first create two custom dialog windows (for example by cloning them from standard ones), then create .rul files with functions, determining behavior for each. After which, include them into main setup.rul and call functions at specific point of time.
Question is - what exact dialog windows/functions/points of time will be best for such task? For reference i searched into "Serial Number Validation Sample Project" but, honestly, the way it customized default window is just confused me even more... So, please, can anybody help? Thank you.
For future reference, here's working solution.
Asked that same question at flexera forums, and here's what I got:
Off the top of my head (without InstallShield handy to check this) 1)
Create an InstallScript project, just accept all of the defaults in
the new project wizard unless you want to add localization or
something. 2) Your description implies that you do not need
maintenance (repair, modify, uninstall) support. If correct go to
Project\Settings and on the Maintenance tab select 'no uninstall or
maintenance'. 3) You can put your code at the top of the
OnFirstUIBefore function and then call Exit so that the rest of that
default code is never executed, since you are not installing anything.
As part of your InstallShield IDE, in the Start menu (for IS2012
Spring) is a tool that demonstrates all of the built in dialogs. You
can look through those choices and select the dialog that is best for
your situation. It sounds like you want to:
Call AskPath or SdAskDestPath (there are several other possibilities)
Then call AskText and save that string.
If you need to make layout or text changes to the default dialogs look
at your Dialogs view and select which ever dialog you selected above
and edit it. (If you decide to use skins make sure you select the skin
before you make any dialog layout changes.)
Then do something similar to the functional body of the WriteLine
example http://kb.flexerasoftware.com/doc/Helpnet/installshield14langref/LangrefWriteLine_Example.htm
The actual WriteLine example function prototype is for a MSI custom
action which is not what you want. Ignore the function protoype and
just use the code in your project to create the file at the path you
already collected and write the line of text that you collected.
Then call Exit;
(big thanks to user phill_mn for that answer)
And here's the code for setup.rul:
#include "ifx.h"
function OnFirstUIBefore()
number nvFileHandle;
string svResult;
string szTargetPath, szFeatures;
BOOL bLicenseAccepted;
begin
AskPath ("Please choose a path where text file will be saved","c:\\",szTargetPath);
MessageBox("File yourtext.txt wiil be created or overwritten at " +szTargetPath, INFORMATION);
AskText ("Please enter some text to save into that file", "Text goes here", svResult);
OpenFileMode (FILE_MODE_APPEND);
if (CreateFile (nvFileHandle, szTargetPath, "yourtext.txt") < 0) then
MessageBox ("Creating failed.", SEVERE);
abort;
else
if (WriteLine(nvFileHandle, svResult) < 0) then
MessageBox ("Writing failed.", SEVERE);
else
MessageBox ("Success.", INFORMATION);
endif;
endif;
CloseFile (nvFileHandle);
Do(EXIT);
return 0;
end;

Watin AttachTo: Timeout while waiting for frame document becoming available

I am trying to make WatiN attach to an IE popup window (IE 10).
This popup contains a frameset --> a single frame --> a pdf document.
My goal is to save this pdf to my disk.
Dim winExists = IE.Exists(Of IE)(Find.ByUrl(Function(url) url.Contains("__ADFvDlg")))
If winExists Then 'this evaluates to true
Dim win = IE.AttachTo(Of IE)(Find.ByUrl(Function(url) url.Contains("__ADFvDlg"))) ' Timeout while waiting for frame document becoming available
End If
1) I have tried using the above code inline or in a STA thread
2) When coded inline, its parent thread is also STA
3) I have tried to increase the default timeout to 8 minutes, same result after 8 minutes have passed
There is no other option for me than to parse this particular popup, since it is a site built with Oracle ADF and, apart from the fact that it is A MESS, it is very strange at times...this popup has a URL that somehow works only once. If I try to use it in another window, no pdf is returned. The same happens when I refresh the popup.
I cannot fetch the PDF in the Temporary Internet Files since it is not there (I suppose this is because the website works under SSL).
Any guidelines or solutions even outside WatiN's scope is more than welcome since I've hit a brick wall.
Technologies: VS2012, WPF
Thanks a lot in advance.
I found it easiest when I tried the same thing by making the pop-up show up as a new tab. That way I could attach to it's URL. From there I would use
File.WriteAllText(fileName, responseDownLoad.Content.ReadAsStringAsync().Result);
Where responseDownload will be a HttpResponseMessage

Issue with configuring conTEXT to compile for Unrealscript

I have been going through Rachel Cordone's Unreal Development Kit Game Programming with UnrealScript Beginner's Guide book and having an issue using the conTEXT text editor.
As per instructed through the book I have followed all the steps to configure it but it won't compile once I press F9 - considering the last step to configure is to set the Enivronment Options/Execute Keys section. Here are the steps the book lays out (just that certain tab):
7) Now we are going to set up the conText to compile code. On the Execute Keys tab, click on Add, then type .uc into the Extensions field that comes up.
8) Once that's done four keys, F9 through F12, will show up in the User Exec Keys window. Let's click on F9 to make it convenient. Once clicked the option on the right become available.
9) For the Execute line, click on the button to the right of the field and navigate to out UDK installation's Binaries\Win64 folder, and select UDK.exe. For Start In, copy the Execute line but leave out UDK.exe.
10) In the Parameters field, type "make" without the quote marks. This tells UDK.exe that we want to compile code instead of opening the game.
11) Change Save to All Files Before Execution.
12) Check Capture Console Output and Scroll Console to the Last Line...
Then all I have to do is press F9 and it will compile - but it doesn't! It gives me:
No user command associated with extension '.uc'
Use 'Environment Options/Execute Keys' dialog to assign commands.
It seems it is not registering the changes no matter what I do (yes I clicked apply before saying okay but even still nothing). Any ideas?
The instructions may be out of date. You'll need to select your ".uc" entry, hit "Edit", and change it to just "uc".
Also, if you use UDK.com instead of UDK.exe the console output will go directly into Context instead of going to a separate popup.

Resources