#1 2021-03-07 18:12

Foebane
Member
Registered: 2021-03-07
Posts: 2

PascalScript - Can constant arrays be used?

I find that while I can use variable arrays in PascalScript, the same cannot be said for an array of constants, be they integers or chars.

Is this a limitation of PascalScript?

Offline

#2 2021-03-08 20:19

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: PascalScript - Can constant arrays be used?

Unfortunately, constant arrays are not supported in PascalScript.

However, you could define your array as a string with delimiters, and then split it, like so:

var
  Words: TWideStringArray;
begin
  Words := WideSplitString('The quick brown fox jumps over the lazy dog', ' ');
  FileName := WideJoinStrings(Words, ',');
end.

Reference:
https://www.den4b.com/wiki/ReNamer:Pasc … :Functions

Offline

#3 2021-03-08 20:48

Foebane
Member
Registered: 2021-03-07
Posts: 2

Re: PascalScript - Can constant arrays be used?

Thanks all the same, I just wanted to make my code more efficient, but what I've got works fine at the moment. smile

Offline

Board footer

Powered by FluxBB