Using ScriptFollows from another NameSpace
2 posts
• Page 1 of 1
Using ScriptFollows from another NameSpace
I am starting to like more and more the function 'ScriptFollows' found in the MiServer workspace (thanks Brian) to insert XAML into a function. So I decided to put it with the other utility functions in the UTILITY namespace and call it from there when ever it was needed... and it stop working. Looks like the culprit is ⎕SI that needed to be changed to ⎕XSI and everything is working fine again. I though I would share this information in case others run into the same issue.
The function is using (⎕IO ⎕ML)←0 3
Anyone using something similar to input matrix of characters in a function that would like to share is welcome.
- Code: Select all
r←ScriptFollows;dtlb
⍝ treat following commented lines in caller as a script, lines beginning with ⍝⍝ are stripped out
dtlb←{⍵{((∨\⍵)∧⌽∨\⌽⍵)/⍺}' '≠⍵}
r←{∊{'⍝'=⊃⍵:'' ⋄ ' ',dtlb ⍵}¨1↓¨⍵/⍨∧\'⍝'=⊃¨⍵}dtlb¨(1+2⊃⎕LC)↓⎕NR 2⊃⎕XSI
The function is using (⎕IO ⎕ML)←0 3
Anyone using something similar to input matrix of characters in a function that would like to share is welcome.
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: Using ScriptFollows from another NameSpace
Yes, that function is a great idea and enables nice notation :-)
I also had a go at it and ended up with more lines that you:
I'm adding linebreaks there because I always use it to generate JS etc., but for an even more generalized version we might supply that "line-separator" as ⍺ and return a matrix if there is no ⍺.
I also had a go at it and ended up with more lines that you:
fn←ExtractTheFollowingComments
fn←(1⊃⎕RSI).⎕NR 2⊃⎕SI ⍝ repr. of calling fn
fn←(1+⎕LC[2])↓fn
fn←1↓¨(∧\{z←∧\⍵∊' ⍝' ⋄ '⍝'∊z/⍵}¨fn)/fn
fn←#.HTMLUtils.enlist fn,¨⎕UCS 13
I'm adding linebreaks there because I always use it to generate JS etc., but for an even more generalized version we might supply that "line-separator" as ⍺ and return a matrix if there is no ⍺.
-
MBaas - Posts: 156
- Joined: Thu Oct 16, 2008 1:17 am
- Location: Gründau / Germany
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group