Old Basic commands.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe

    #1

    Old Basic commands.

    Hi all...
    In the old Quick Basic days there used to be 3 commands that seem to have
    disappeared from the new visual basic. I was wondering if there are
    equivalent commands to the VarPtr, Peek, and Poke commands of the old basic
    in the new .net visual basic.

    What I am trying to do here is lets say I have a constant variable

    Dim A as string = "Panama" or Const A as String = "Panama"

    At run time, I would like to change the A variable to let's say Canada, so
    after the application is closed and then run again, the A variable will be
    equal to Canada.

    If so, can someone show me some examples of how to do this please and thank
    you.

    Joe


  • Herfried K. Wagner [MVP]

    #2
    Re: Old Basic commands.

    "Joe" <firefox@telus. netschrieb:
    In the old Quick Basic days there used to be 3 commands that seem to have
    disappeared from the new visual basic. I was wondering if there are
    equivalent commands to the VarPtr, Peek, and Poke commands of the old
    basic in the new .net visual basic.
    >
    What I am trying to do here is lets say I have a constant variable
    >
    Dim A as string = "Panama" or Const A as String = "Panama"
    >
    At run time, I would like to change the A variable to let's say Canada, so
    after the application is closed and then run again, the A variable will be
    equal to Canada.
    This even could not be archieved using 'VarPtr', 'Peek' and 'Poke'! You may
    want to use 'My.Settings' (VB 2005), 'Microsoft.Win3 2.Registry',
    'GetSetting' and 'SaveSetting', one of the methods described in the article
    mentioned below to persist the changes and reload them when the application
    gets started again.

    Storing and loading user preferences
    <URL:http://dotnet.mvps.org/dotnet/faqs/?id=userprefere nces&lang=en>

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Michel Posseth [MCP]

      #3
      Re: Old Basic commands.

      'VarPtr', 'Peek' and 'Poke' are used to manipulate memory

      so it would be possible to change the value on a certain location

      however restarting the prog / computer would give you the start values of
      the variabels

      only way you can achieve what you want is using disk based IO routines
      you can do this in several ways

      Database , registry , flatfile , XML , serialization of objects etc etc

      regards

      Michel Posseth [MCP]






      "Herfried K. Wagner [MVP]" wrote:
      "Joe" <firefox@telus. netschrieb:
      In the old Quick Basic days there used to be 3 commands that seem to have
      disappeared from the new visual basic. I was wondering if there are
      equivalent commands to the VarPtr, Peek, and Poke commands of the old
      basic in the new .net visual basic.

      What I am trying to do here is lets say I have a constant variable

      Dim A as string = "Panama" or Const A as String = "Panama"

      At run time, I would like to change the A variable to let's say Canada, so
      after the application is closed and then run again, the A variable will be
      equal to Canada.
      >
      This even could not be archieved using 'VarPtr', 'Peek' and 'Poke'! You may
      want to use 'My.Settings' (VB 2005), 'Microsoft.Win3 2.Registry',
      'GetSetting' and 'SaveSetting', one of the methods described in the article
      mentioned below to persist the changes and reload them when the application
      gets started again.
      >
      Storing and loading user preferences
      <URL:http://dotnet.mvps.org/dotnet/faqs/?id=userprefere nces&lang=en>
      >
      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>
      >
      >

      Comment

      • Joe

        #4
        Re: Old Basic commands.

        Hello Herfried and Michel,
        Thank you for your response to my question about Peek, Poke and Varptr.
        I was hoping that there would be a way to find the address of a variable and
        then change it by poking other characters into it just like the old Quick
        basic. Right now I am already using the IO file system to do this.
        I wonder why Microsoft decided to exclude these commands out of the new
        Visual Basic versions....

        Thanks again
        Joe



        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: Old Basic commands.

          "Joe" <firefox@telus. netschrieb:
          Thank you for your response to my question about Peek, Poke and Varptr.
          I was hoping that there would be a way to find the address of a variable
          and then change it by poking other characters into it just like the old
          Quick basic.
          I am wondering why you'd want to do that. It's absolutely not necessary!
          Right now I am already using the IO file system to do this.
          I wonder why Microsoft decided to exclude these commands out of the new
          Visual Basic versions....
          These commands simply do not make much sense any more and pose a security
          risk.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://classicvb.org/petition/>

          Comment

          Working...