Results 1 to 2 of 2

Thread: Virtual dynamic Strings

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,525
    Rep Power
    170

    Virtual dynamic Strings

    Impossible? Who said that?
    '---Script created on 04-03-2022 08:21:35 by ReneMiner
    
    
    uses "console"
    
    ' - - -  real string
    string a = "Hello"      
                             
      ' - - -  data for the virtual string 
     dword b = heap_allocbystr(mkdwd$(5) & "World") 
    
    
    
     ' allocated above a dynamic String-structure: 
    '  StrLen As Dword & bChar(StrLen) As Byte 
    
    
    dword C = b + 4         ' <<< virtual StrPtr
    
    string V             ' virtual string  <<<
    
    ' real string output:
    
        Print a & $spc 
     
    
    
        memory_swap(varptr(V), varptr(c), 4)   'place a layover
    
    
    ' virtual string output:
    
       printl V & " !"
    
    
    
        memory_swap(varptr(V), varptr(c), 4)  'put it back 
          
    waitkey 
    
    
    'hints
    'printl "Varptr( a ) " & str$(Varptr( a ))
    'printl "StrPtr( a ) " & Str$(Strptr( a ))
    'printl str$(peek(Dword, varptr(a)))
    
    of course - it's virtual.
    Not real but not a fake neither.

    Allows using the "fast" string methods on memory. The keywords in the string-functions list that end with F
    sadly no InstrF available...
    Last edited by ReneMiner; 03-04-2022 at 09:25.
    I think there are missing some Forum-sections as beta-testing and support

  2. #2
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,525
    Rep Power
    170
    i thought this would loose an avalanche... but if no one reads it - nobody will ever know.

    guess i must create a module to make use oif this and everyone will be surprised - except the reader of this thread
    I think there are missing some Forum-sections as beta-testing and support

Similar Threads

  1. VR, virtual reality, AR
    By alberto in forum Suggest new module
    Replies: 4
    Last Post: 26-02-2024, 14:55
  2. With {As|Like} vartype At- a virtual idea
    By ReneMiner in forum Suggestions/Ideas discussions
    Replies: 0
    Last Post: 30-01-2015, 19:57
  3. Microsoft Virtual PC 2007 SP1
    By ErosOlmi in forum Technology
    Replies: 3
    Last Post: 22-05-2008, 00:02

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •