Difference between revisions of "User:QQuix/Array sample code"

m
Minor text and code changes
imported>QQuix
(Array deep dump - sample code)
 
imported>QQuix
m (Minor text and code changes)
Line 16: Line 16:
This code has the same debugging purpose as ar_Dump, but intended to show the contents of nested arrays, or arrays within arrays.
This code has the same debugging purpose as ar_Dump, but intended to show the contents of nested arrays, or arrays within arrays.


It dumps the array to the console and to a text file (requires Pluggy)
It dumps the array to the console and to a text file (requires Pluggy), but either can be easily removed, if you prefer. It is also easy to customize the contents and formatting to your liking.


It has two modes.  
It has two modes.  
Line 171: Line 171:
       let sTab := sTab5
       let sTab := sTab5
       set xNext to 0
       set xNext to 0
    ;=== Add additional ElseIf's here to to handle deeper arrays ===
     endif
     endif
   
   
Line 265: Line 266:
                               StringToTxtFile psFile  psLine
                               StringToTxtFile psFile  psLine
         endif
         endif
         set xNextLevel to xLevel + 1
         if xNext ; stops recursion at the last level initialized
        let aaqqArrayDump.gaKeys [xNextLevel] := sKey1
          set xNextLevel to xLevel + 1
        let aaqqArrayDump.gaArrays [xNextLevel] := aEntry [Value]  
          let aaqqArrayDump.gaKeys [xNextLevel] := sKey1
        xNext.activate2 xSelf 1
          let aaqqArrayDump.gaArrays [xNextLevel] := aEntry [Value]  
        ar_Erase aaqqArrayDump.gaKeys xNextLevel
          xNext.activate2 xSelf 1
        ar_Erase aaqqArrayDump.gaArrays xNextLevel
          ar_Erase aaqqArrayDump.gaKeys xNextLevel
          ar_Erase aaqqArrayDump.gaArrays xNextLevel
        endif
       endif
       endif
     loop
     loop
Anonymous user