Jump to content

Application.savevalue


0mh3r
 Share

Recommended Posts

[code]user_name = "";
-- Loop until a valid user name is entered or the user cancels.
while (user_name == "") and (user_name ~= "CANCEL") do
--Prompt the user for their user name.
user_name = Dialog.Input("User Information", "Please enter your user name:", "", MB_ICONQUESTION);

-- If the user does not enter any text, display an error message. The loop will continue from the beginning.
if user_name == "" then
result = Dialog.Message("Error", "Your information could not be processed as entered. Please try again.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);

-- If the user entered a valid user name and didn't cancel, store the value in the Registry.
elseif name ~= "CANCEL" then
Application.SaveValue("Your_User_Name", "Your_Key", user_name);

-- Check to see if there was an error saving.
error = Application.GetLastError();
end
end

-- If the user didn't cancel and there was no error saving,
-- Load the user name from the registry and display a welcome dialog.
if (user_name ~= "CANCEL") and (error == 0) then
loaded_username = Application.LoadValue("Your_User_Name", "Your_Key");

-- If the value loaded successfully.
if (Application.GetLastError() == 0) then
result = Dialog.Message("Hello", "Welcome "..loaded_username.."!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
end

[/code]



user_name = Dialog.Input("User Information", "Please enter your user name:", "", MB_ICONQUESTION);

Kodu Yerine

user_name = Input.GetText("Input1");

Kodunu Kullanmak İsiyorum Input doluyken Çalışıyor ama boş iken donup kalıyor lütfen bi yardımm edin.
Link to comment
Share on other sites

[codebox]user_name = "";

-- Loop until a valid user name is entered or the user cancels.

while (user_name == "") do

--Prompt the user for their user name.

-- user_name = Dialog.Input("User Information", "Please enter your user name:", "", MB_ICONQUESTION);
user_name = Input.GetText("Input1");


-- If the user does not enter any text, display an error message. The loop will continue from the beginning.

if user_name == "" then

result = Dialog.Message("Error", "Your information could not be processed as entered. Please try again.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);

break

-- If the user entered a valid user name and didn't cancel, store the value in the Registry.

else

Application.SaveValue("Your_User_Name", "Your_Key", user_name);



-- Check to see if there was an error saving.

error = Application.GetLastError();

end

end



-- If the user didn't cancel and there was no error saving,

-- Load the user name from the registry and display a welcome dialog.

if (user_name ~= "CANCEL") and (error == 0) then

loaded_username = Application.LoadValue("Your_User_Name", "Your_Key");



-- If the value loaded successfully.

if (Application.GetLastError() == 0) then

result = Dialog.Message("Hello", "Welcome "..loaded_username.."!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

end

end[/codebox]

Dediğini tam anlamamakla beraber sanırım şunu demek istedin.Bu kodları dener misin?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...