Loading ...
Sorry, an error occurred while loading the content.

23949Re: [NTB] Generate Random Alphanumeric Codes

Expand Messages
  • flo.gehrke
    Aug 21, 2013
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, Don <don@...> wrote:
      >
      > :Loop
      > ^!InsertText ^$StrRandom(10;A..F0..9)$^P
      > etc.
      >
      > Which would take about 40 seconds to generate 10000 unique codes of
      > 10 characters each. They might also have more elegant solutions
      > that would be faster ...

      Don,

      Inserting line by line makes it rather slow here. It's done in a second when first creating the list in the memory...

      ^!SetHintInfo Working...
      ^!Set %Counter%=10000
      :Loop
      ^!Set %Str%=^$StrRandom(10;A..F0..9)$
      ^!Append %List%=^%Str%^%NL%
      ^!Dec %Counter%
      ^!If ^%Counter% > 0 Loop
      ^%List%
      ^!ClearVariables

      Regards,
      Flo
    • Show all 6 messages in this topic