Page 1 of 1
Editor: Intelligent Copy + Paste
Posted: Fri Dec 23, 2005 8:51 pm
by Killswitch
I don't know about you, but when I'm starting a project I often find it nessacary to hardcode in large amounts of information into arrays.
And because of that I usually copy and paste a set I've already completed, like so:
Code: Select all
Commands(1)\Name="push"
Commands(1)\Number=1
Commands(1)\Parameters=1
Commands(1)\Type[1]=#Type_Any
Of course I have to redefine what each array holds, but thats a given. What bugs me is that I also have to redefine the index of the array. I think it'd be a nice feature if there was a special paste function that automatically updated the index of the array, ala - excell.
A minor thing, but it'd save me a lot of keystrokes

.
Posted: Fri Dec 23, 2005 8:58 pm
by Trond
If I need to have it really large I usually find it more conventiently to store the data in a file or data section and load it at program startup. Or I write a program to output the code for me.
Posted: Fri Dec 23, 2005 10:27 pm
by Killswitch
Yeah I do that too sometimes; however I get a bit parnoid about doing things that way:
1) Adds a layer (unnessacary) complexity to the code
2) Slows down program startup
3) What happens if a file is corrupted or non existant?
I prefer to have it all directly in the code.
Posted: Sat Dec 24, 2005 5:28 pm
by remi_meier
I would like to see it like this:
Posted: Sat Dec 24, 2005 6:52 pm
by josku_x
remi_meier wrote:I would like to see it like this:
Yeah, making an array so easily would be cool, but now it's just a dream. perhaps Fred has something like this in PB4?
I talk too much of PB4 but I am so surprised as Fred promises so good things about it
^Or did he promise a bit too much?

Posted: Sun Dec 25, 2005 12:35 pm
by Fred
We never promised such stuff, so it's not helpful to mention 'it will may be put in PB4' in every post if you don't know anything about it.
Posted: Sun Dec 25, 2005 5:12 pm
by Dare2
Hi Killswitch.
I know this is the wishlists, but here's a couple of small solutions that may help. Because I am lazy I do this sort of thing.
Code: Select all
i=0 : arr(i)="gobble"
i+1 : arr(i)="dy"
i+1 : arr(i)="gook:
; or
i=0
arr(i)\fld1 = 1
...
arr(i)\fld99 = 99
i+1
arr(i)\fld1 = -1
...
arr(i)\fld99 = -99
And then cut and paste for each instance.
An alternative sometimes used: Open a file
junksomething.pb and then
Code: Select all
emptyQuote.s = chr('"') + chr('"') ; or Chr(34) if you prefer.
For i = 0 to huge
WriteStringN("Arr(" + Str(i) + ")\StrFld = " + emptyQuote
WriteStringN("Arr(" + Str(i) + ")\NumFld = "
Next
and then load, select and copy that into the real prog.
Not real clever but cuts down on typos and saves some typing.
Posted: Sun Dec 25, 2005 6:48 pm
by josku_x
Fred wrote:We never promised such stuff, so it's not helpful to mention 'it will may be put in PB4' in every post if you don't know anything about it.
Calm down, I mean you promise things like:
If you have PB4.0 you don't want to use 3.94 anymore!
or something like that, and I say maybe it's in PB4 because, it would pay you attention and maybe you really add it, it's like catching the fish in the net and feeding it and letting it out of the net. capich?
