Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. how i can redefine string

how i can redefine string

Scheduled Pinned Locked Moved Visual Basic
help
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mr kilany
    wrote on last edited by
    #1

    is there some thing called re dim S as string i need to redefine string because the fist time this string work as i want but the second time i face some problem in this parameter so i need to redefine this parameter for each click on button kilany

    H F 2 Replies Last reply
    0
    • M Mr kilany

      is there some thing called re dim S as string i need to redefine string because the fist time this string work as i want but the second time i face some problem in this parameter so i need to redefine this parameter for each click on button kilany

      H Offline
      H Offline
      HaloZa
      wrote on last edited by
      #2

      What is it that you are trying to do? if you just want to change what the string is equal to then dim s as string s = "hello" s = "world"

      1 Reply Last reply
      0
      • M Mr kilany

        is there some thing called re dim S as string i need to redefine string because the fist time this string work as i want but the second time i face some problem in this parameter so i need to redefine this parameter for each click on button kilany

        F Offline
        F Offline
        FrankyT
        wrote on last edited by
        #3

        you may be having scope issues. if your declaring a local variable in vb with "Dim", then taht variable is only valid inside that block. EX sub main() thing() otherthing end sub private sub thing() dim x as string = "Hello" debug.writeline(x) end sub private sub otherthing() debug.writeline(x) 'This line causes an error. end sub the second reference to 'x' causes an error because it was declared within a block. to declare globals within a class or module, use : Private x as string = "Hello" sub main() thing() otherthing() end sub private sub thing() x = "Hello" debug.writeline(x) end sub private sub otherthing() debug.writeline(x & " Again") 'No error this time end sub Globals are just one answer to a scope issue. paramater passage and other techniques exist. you'll learn 'bout 'em sooner or later Good Luck hey...slang is the vernacular for the vernacular...wow

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups