Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3706 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi Guys,

 

I'm trying to create a Virtual list, so far it seems to be working great. I populate a global variable called $$MyData and display the results via a VL.

 

Is it possible to to inset a value into line 24 of $MyData using one of the commands or do I have to write a custom function to do this. I've seen there are a couple of custom functions which can extract a line out based on a line number, but Im interested if my $counter says 24, the value goes into line 24 of $$MyData.

 

Many thanks

Jalz

Posted

but Im interested if my $counter says 24, the value goes into line 24 of $$MyData.

 

The nice thing about Custom Functions is that you can write them yourself, like

Let ( [
  lineNumber = Int ( GetAsNumber ( lineNumber ) ) ;
  newLast = ValueCount ( theList ) + 1
  ] ; 
  Case ( 
    lineNumber < 1 ; "Only positive integers for the line number, please!" ;
    lineNumber > newLast ; "Out of bounds error" ;
    lineNumber = 1 ; List ( newLine ; theList ) ;
    lineNumber = newLast ; List ( theList ; newLine ) ;
    Replace ( theList ; Position ( theList ; ¶ ; 1 ; lineNumber - 1 ) ; 0 ; ¶ & newLine )
  )
)

This topic is 3706 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.