ecook Posted April 13, 2003 Share Posted April 13, 2003 I have used the ScriptMaker to clear 4 fields in a layout using the "Clear" script. This is working fine but I need a way to press a button to clear the four fields for ALL records, not just the current record being browsed. Any ideas? Link to comment Share on other sites More sharing options...
danjacoby Posted April 13, 2003 Share Posted April 13, 2003 Once you've cleared the field, use the "Replace" command. Link to comment Share on other sites More sharing options...
RodinBangkok Posted April 13, 2003 Share Posted April 13, 2003 First either show all records, or find particular set you want to work on. the following script will loop thru the found set performing whatever steps you place just below the Loop step. Be carefull with this kind of loop, back up first, there is no undo if you mess up. I would recommend first writing the script without the loop steps (Loop,EndLoop), try it on a single record, if it works to your liking then put the loop steps in. Goto Record/request/page [first] Loop ---put your steps here---- go to record/request/page [exit after last,Next] End Loop Rod Link to comment Share on other sites More sharing options...
ecook Posted April 13, 2003 Author Share Posted April 13, 2003 This worked great! Thanks! Elgin Link to comment Share on other sites More sharing options...
Anatoli Posted April 13, 2003 Share Posted April 13, 2003 Why Loop? Why not 4 times Replace as was suggested by danjacoby? Link to comment Share on other sites More sharing options...
ecook Posted April 13, 2003 Author Share Posted April 13, 2003 I didn't understand how to use the Replace suggested by danjacoby so I tried the other. Does Replace work better? Link to comment Share on other sites More sharing options...
Ugo DI LUCA Posted April 14, 2003 Share Posted April 14, 2003 Hi, Yes, it's quicker. While being in the field, using the replace function would replace the actual content (empty if cleared previously) in all records. Show all records Go to Layout Go to Field (select) Clear Replace (no dialog) Go to Field 2 (select) Clear ..... Fo to Field 4 Clear Back where you where. Link to comment Share on other sites More sharing options...
danjacoby Posted April 14, 2003 Share Posted April 14, 2003 I'm just lazy, that's all. Link to comment Share on other sites More sharing options...
Vaughan Posted April 14, 2003 Share Posted April 14, 2003 I've started using looped Set Fields instead of Replace recently. I have a feeling it's faster but not sure -- it's definately not slower. I recently spent half a day improving a complicated process that involved four looped Set Fields with (each Set Field looped through the found set individually) with one loop with the four Set Fields inside it, thinking it'd speed up the process. It made no difference (in fact the whole process was 5% slower!). I don't like having a process rely on being on a particular layout with particular fields on it if at all possible. Link to comment Share on other sites More sharing options...
ecook Posted April 14, 2003 Author Share Posted April 14, 2003 Thanks for the instructions... I appreciate it. -) Elgin Link to comment Share on other sites More sharing options...
Ugo DI LUCA Posted April 14, 2003 Share Posted April 14, 2003 Hi Vaughan, My assuptions of Replace being quicker was based on what I've been reading in one other post here on the Forum. I do not have a file in which I could reasonably test both methods but I keep it in mind... Thanx. Link to comment Share on other sites More sharing options...
Ugo DI LUCA Posted April 14, 2003 Share Posted April 14, 2003 Hi Vaughan, Here was the thread. Not involving replace function but Copy All records though... Pupiweb said "Actually I usually opted for a looping script putting the IDs in the global (because it's not layout-dependent and doesn't require that the user has export privileges) but I discovered it's much slower (5 times slower) ..." I finally run the test in my line item (8,264 records linked to many db) with a new field and a g_starthour and g_endhour in the script. The delay result is Replace function : 00:01:24 SetFieldLoop : 00:02:50. Not 5 times, but twice quicker with Replace. Link to comment Share on other sites More sharing options...
Anatoli Posted April 14, 2003 Share Posted April 14, 2003 RE Vaughan's: I don't like having a process rely on being on a particular layout with particular fields on it if at all possible. That is definitely *best* practice, no doubt about it. IMHO and without test -- replace will be faster, but the field *must* be on layout and accessible. Link to comment Share on other sites More sharing options...
danjacoby Posted April 14, 2003 Share Posted April 14, 2003 Anatoli, you are soooo right! And I'm the one who suggested the Replace idea. Link to comment Share on other sites More sharing options...
Vaughan Posted April 14, 2003 Share Posted April 14, 2003 Thanks Ugo for quantifying the results! Is it possible you could share the file you used to perform the test? Link to comment Share on other sites More sharing options...
Ugo DI LUCA Posted April 15, 2003 Share Posted April 15, 2003 Hi Vauhan, It's a 18,8Mo file and a line item related to 14 db! If you have a ftp, I could upload it to you. In the meanwhile, here are some system information. Running on Imac Mac OS 8.6 3go/96Mo (first IMacs). Really want to try it ? Would you think this kind of stuff would change (reverse) according to the system running ? Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7846 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now