Jump to content
Sign in to follow this  
Chewett

How To Store Values/variables Using Mdscript

Recommended Posts

Copied From Murs initial Post (no code changed)

How to Store values/variables using MDScript

[php]//code in item A
@vh = "wow thats simple";
store(@vh);

//code in item B
retrieve(@vh);
echo @vh;

//will output "wow thats simple"
//can be used to store and load entire arrays of data.[/php] Edited by Chewett

Share this post


Link to post
Share on other sites

Only one variable can be stored at a time this way. Trying to store another variable will overwrite the one you've previously stored.

 

Code:

[php]

//let's set some variables
@va = "5";
@vb = "2";

//echo them to confirm contents
echo @va."<br>";
echo @vb."<br><br>";

//store and retrieve both of them
store(@va);
store(@vb);
retrieve(@va);
retrieve(@vb);

//echo again to see how they've changed!
echo @va."<br>";
echo @vb;

[/php]

 

Output:


5
2

2
2

Share this post


Link to post
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.

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.

Loading...
Sign in to follow this  

  • Forum Statistics

    15,833
    Total Topics
    173,500
    Total Posts
  • Recently Browsing

    No registered users viewing this page.

  • Upcoming Events

    No upcoming events found
  • Recent Event Reviews

×
×
  • Create New...