/*sfd.aml 10/25/01 /*---------------------------------------------------GLOBAL VARIABLES /* /* .sf$totrec Total record count /* .sf$endrec # value of last record /* .sf$currec Current record index number /* .sf$getrec Search Record in read index loop. /* .sf$qryrec Returned Value from Response window /* .sf$recidx Active Selection Index File /* .sf$selidx Open routine Selection Index File /* .sf$savidx Save routine Selection Index File /*-----------------------------------------------------INPUT / OUTPUT /* Start with selected set of features /*-----------------------------------------------------------ROUTINES /* F * Forward /* R * Reverse /* E * Enter /* O * Open /* S * Save /* M * Menu /* Q *** Quit /* N *** New /* Usage * Duh! /* OPEN/NEXT/CLOSE * File Read Structure /* Error * Bailout Routine /*------------------------------------------------------------CREDITS /* user: Geotopo Inc. /* programmer: J.Johnston /* 510.763.2239 ext.15 /*--------------------------------------------------------------NOTES /* This tool creates an index of selected features and allows the /* user to step through those features one by one for editing. /* All variables are active until sfd q is run! /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> &severity &error &routine error &args routine val &if [null %routine%] &then &call Usage &else &call %routine% &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*------------------------------------------------------------- Usage &routine Usage &ty USAGE: SFD < Routine: F,R,E,Q,N > {val: record to view} &ty F Forward: Move Forward Through Select Feature Index File &ty R Reverse: Move Backward Through Select Feature Index File &ty E Enter: Enter Select Feature Record Number To View &ty O Open: Open Selection Index File &ty S Save: Save Selection Index File &ty M Menu: Open Select Feature Dialog Menu &ty Q Quit: Remove Select Feature Dialog Variables &ty N New: Define Select Feature Selection Set &re &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*----------------------------------------------------------- Forward &routine F &if ^ [variable .sf$recidx] &then &re No Selection Index, Use sfd n to set up selections! &s .sf$currec %.sf$currec% + 1 &if %.sf$currec% > %.sf$totrec% &then &do &s .sf$currec %.sf$currec% - 1 &re No More Records! &end &else &call Z &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*----------------------------------------------------------- Reverse &routine R &if ^ [variable .sf$recidx] &then &re No Selection Index, Use afd n to set up selections! &s .sf$currec %.sf$currec% - 1 &if %.sf$currec% = 0 &then &do &s .sf$currec %.sf$currec% - 1 &re No Previous Records! &end &else &call Z &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*------------------------------------------------------------- Enter &routine E &if [null %val%] &then &do &mess &popup &s qstr = Enter a number between 1 and [value .sf$totrec] &s .sf$qryrec [response [quote [unquote %qstr%]] ] &mess &on &end &else &s .sf$qryrec %val% &if [null %.sf$qryrec%] &then &re no value entered, selection remains at %.sf$currec% &else &do &s .sf$currec %.sf$qryrec% &call z &end &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*-------------------------------------------------------------- Open &routine O &s .sf$selidx [getfile [dir[show ec]]\*.txt -FILE 'Choose Selection File' -none -other ] &if [null %.sf$selidx%] &then &re &else &do &s infile %.sf$selidx% &call open sel [entryname [show ec]#] = [after %rec% ,] &if [show number select] = 0 &then &re Selection File %.sf$selidx% Not Compatible with Current Edit Cover! &else &s %.sf$recidx% %.sf$selidx% &call close &end &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*-------------------------------------------------------------- Save &routine S &mess &pop &s qstr = Save Selection Set Index File As &s .sf$qryrec [response [quote [unquote %qstr%]] [entryname[show ec].txt]] &mess &on &if [null %.sf$qryrec%] &then &re Save Canceled &else &do &s .sf$savidx %.sf$qryrec% &s unitw [open %.sf$savidx% openstat -write] &s infile %.sf$recidx% &call open &do &while %readstat% = 0 &s writestat [write %unitw% %rec%] &call next &end &s closestat [close %unitw%] &call close &end &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*-------------------------------------------------------------- Menu &routine M &re Coming Soon! &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*-------------------------------------------------------------- Quit &routine Q mape bnd [show ec] &s del [delete %.sf$recidx% -file] &dv .sf$* &ty Arcedit Feature Driver Variables Removed! &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*--------------------------------------------------------------- New &routine N &if [show number select] = 0 &then &re Define a Selected Set for the Feature Driver to index! &if [variable .sf$recidx] &then &s del [delete %.sf$recidx% -file] &mess &off &s .sf$recidx [scratchname -suffix fdx -file] &s unitw [open %.sf$recidx% openstat -write] cursor open &s count = 1 &do &while %:edit.AML$NEXT% &s writestat [write %unitw% %count%,[value :edit.[entryname [show ec]]#]] &s count = %count% + 1 cursor next &end &s .sf$totrec %count% - 1 &s closestat [close %unitw%] cursor close &s infile %.sf$recidx% &call open &do &while %readstat% = 0 &s last [after %rec% ,] &call next &end &call close &s .sf$endrec %last% /* we changed this value from 1 to 0 &s .sf$currec = 0 &mess &on &ty %.sf$totrec% Features in Selection Index &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*-------------------------------------------------------------- Zoom &routine Z &s infile %.sf$recidx% &call open &s .sf$getrec %.sf$currec% /*&if %.sf$currec% = 2 &then /* &call badhack &do i = 1 &to %.sf$getrec% &by 1 &s .sf$currec = [before %rec% ,] &s .sf$recval = [after %rec% ,] &call next &end &call close sel [entryname[show ec]#] = %.sf$recval% mape sel draw ds &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /*------------------------------------------------------------- error &routine error &mess &on &re Hey, Take it easy will ya! &re /*_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-> /**************** OPEN/NEXT/CLOSE *********** &routine open &s unitr = [open %infile% openstat -read] &s rec = [read %unitr% readstat] &re &routine next &s rec = [read %unitr% readstat] &re &routine close &s closestat = [close %unitr%] &re /*************** *************** ************** /*---------------------------------------------------------- /*** really nasty hack to fix selection skip on first iteration of /* F routine. &routine badhack &do i = 1 &to %.sf$getrec% &by 1 &s .sf$currec = [before %rec% ,] &s .sf$recval = [after %rec% ,] */ &call next &end &call close sel [entryname[show ec]#] = %.sf$recval% mape sel draw ds &re