saw=: 3 : 0 a=:234 b=:3*a c=.4*a erase 'a' ) saw 3 : 0 a=:234 b=:3*a c=.4*a erase 'a' ) a |value error: a b 70296 c |value error: c Linda
-----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Linda Alvord Sent: Friday, April 05, 2013 1:34 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Obtaining the file path of an ijs file I forgot to "run" see. Sorry. Linda -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Linda Alvord Sent: Friday, April 05, 2013 1:30 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Obtaining the file path of an ijs file see=: 3 : 0 a=:234 b=:3*a erase 'a' ) a |value error: a b 70296 Linda -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of bob therriault Sent: Thursday, April 04, 2013 11:11 PM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Obtaining the file path of an ijs file Nice to have the new voices on the message board. :) I usually use erase [: 4!:55 ;: ::] The argument is the name of the variable that you want to erase and the response is 1 for each variable erased. t=: 'test' r= "gone" erase 't r' 1 1 t |value error: t cheers, bob On 2013-04-04, at 7:29 PM, Greg Borota wrote: > I think if you put this on top of your script file, it will always > work (before any other code might have a chance to load some other script). > scriptPath=.<_1{4!:3'' > > I am most probably even more of a beginner than you are so somebody > with more experience could validate if this is indeed reliable. > > Is there a way to unset variables once you no longer need them? Or a > way to define a local to script namespace? > Like you do in batch files: > SETLOCAL > do your work > ENDLOCAL > > > > > On Thu, Apr 4, 2013 at 9:05 PM, Greg Borota <bor...@gmail.com> wrote: > >> Looks like this one works too, inside the script: >> scriptPath=:>(4!:4<'NonExistent'){4!:3'' >> Now to go to the doc and understand how/why it works. >> >> >> On Thu, Apr 4, 2013 at 8:49 PM, Neill Robson <neillrobson...@gmail.com>wrote: >> >>> Tom, that's perfect! Actually, I think Devon mentioned the same or >>> similar line of code, but it was your code that I realized I could >>> use to my advantage. Like I said, I was trying to find the file path >>> to my ijs file, and your code found out the file path to where a >>> particular object is defined - Not necessarily the same intentions, >>> but it gives the same result. I just chose a verb from my ijs to use >>> and it output the file path just like I needed; thank you so much for the >>> help! >>> >>> >>> On Thu, Apr 4, 2013 at 8:58 PM, Linda Alvord >>> <lindaalv...@verizon.net >>>> wrote: >>> >>>> That's handy. >>>> >>>> Linda >>>> >>>> -----Original Message----- >>>> From: programming-boun...@forums.jsoftware.com >>>> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of >>>> Devon McCormick >>>> Sent: Thursday, April 04, 2013 5:55 PM >>>> To: J-programming forum >>>> Subject: Re: [Jprogramming] Obtaining the file path of an ijs file >>>> >>>> Perhaps not exactly what you're asking for as it's more granular >>>> than >>> the >>>> file level, but I've often found this verb useful (thanks, Dan!): >>>> >>>> whereDefined=: 3 : '(4!:4{.;:y) {:: (4!:3''''),<''Source of >>> definition >>>> not found for '',''.'',~y' >>>> >>>> It returns the path of the file in which a J object was defined. >>>> For >>>> example: >>>> >>>> whereDefined 'boxopen_z_' >>>> c:\Program Files (x86)\j64-701\system\main\stdlib.ijs >>>> >>>> With this caveat >>>> >>>> myfoo=: 'Defined only locally' >>>> whereDefined 'myfoo' >>>> Source of definition not found for myfoo. >>>> >>>> >>>> >>>> >>>> >>>> On Thu, Apr 4, 2013 at 5:41 PM, Greg Borota <bor...@gmail.com> wrote: >>>> >>>>> I am newbie too, but would BINPATH_Z_ work for you? >>>>> >>>>> >>>>> On Thu, Apr 4, 2013 at 4:35 PM, Neill Robson < >>> neillrobson...@gmail.com >>>>>> wrote: >>>>> >>>>>> This may seem like a rather simple question compared to the >>>>>> others being brought up, however I cannot seem to be able to find >>>>>> a way to call up an ijs file's "path" for use as a noun. I would >>>>>> like to somehow use it like one would use the "jpath" command >>>>>> when accessing something within the J program files folder, so >>>>>> that one does not have to type out the >>>>> C:/Program >>>>>> Files path name every time. I'm probably missing something >>>>>> obvious, but >>>>> I'm >>>>>> still very much a newbie at J programming. Thank you! >>>>>> ----------------------------------------------------------------- >>>>>> --- >>>>>> -- For information about J forums see >>>>>> http://www.jsoftware.com/forums.htm >>>>>> >>>>> ------------------------------------------------------------------ >>>>> ---- For information about J forums see >>> http://www.jsoftware.com/forums.htm >>>>> >>>> >>>> >>>> >>>> -- >>>> Devon McCormick, CFA >>>> ^me^ at acm. >>>> org is my >>>> preferred e-mail >>>> ------------------------------------------------------------------- >>>> --- For information about J forums see >>>> http://www.jsoftware.com/forums.htm >>>> >>>> ------------------------------------------------------------------- >>>> --- For information about J forums see >>>> http://www.jsoftware.com/forums.htm >>>> >>> >>> >>> >>> -- >>> -Neill >>> -------------------------------------------------------------------- >>> -- For information about J forums see >>> http://www.jsoftware.com/forums.htm >>> >> >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm