Hi!

I believe the simplest is (to work with csv delimited by ";"):


set file = ##class(%File).%New( "data.csv" )
    set sc = file.Open( "R" ) 
    if $$$ISERR(sc) quit    ; or do smth

    while 'file.AtEnd {
        set str=file.ReadLine() 
        for i=1:1:$length( str, ";" ) {
            set id=$piece( str, ";" ,i ) 
            write !, id  // or do smth
        }
    }
    do file.Close()

Possible options:

different variants of error handling with sc code.

Embrace while loop into try/catch block.

And what's yours?

3 16
0 6.5K

Hi!

Want to share with you code snippet of try catch block I usually use in methods which should return %Status.


{ 
 try {
  	$$$TOE(sc,StatusMethod())
 }
 catch e {
 	set sc=e.AsStatus()
 	do e.Log()
 }

Quit sc 
}

Here $$$TOE is a short form of $$$TROWONERROR macro.

Inside macro StatusMethod is any method you call which will return %Status value. This value will be placed into sc variable.

5 21
2 3K

Hi!

In every Atelier project you can find following hidden files:

.buildpath

.version

.connection

.project.

Should I include all of them into commit?

I understand that .project is mandatory. But what about the rest? Is there any general rule?

F.e. if we work in team and everybody has their own connection on locale machine .connection should not be included. Yes?

1 1
0 362

Hi Community!

Meet the new group in Developer Community:

InterSystems Data Platform Blog!

In this group you'll find technical posts form InterSystems engineers and Community about InterSystems Data Platform technology cases which we consider as good or even best practices.

Every article in this blog passes InterSystems engineers' reviewing procedure and only then becomes available. You are very welcome to comment and share it!

1 0
0 263

Hi, Community!

There are only six days left to win InterSystems Developer Community MVP prize.

As it was announced in addition to Free Registration on InterSystems Global Summit winner gets 4 nights stay in the Arizona Baltimore, Waldorf Astoria Resort.

We measure contribution to Developer Community on valuable posts and comments and prepared special leaderboard built on InterSystems DeepSee.

By default, it shows all the members. We added the filter to the dashboard to show leaderboard without members who are InterSystems employees.

So here is current leaderboard without InterSystems members:

2 6
0 250