Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
underscore in in-line block data initialization

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
DH*
Guest





Posted: 07 May 2006, 14:11 PM    Post subject: underscore in in-line block data initialization Reply with quote

This doesn't appear to work. I still get errors when I try it.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 07 May 2006, 16:14 PM    Post subject: Reply with quote

As documented, the continuation underscore must be preceded by at least one space or tab, both in regular code and in in-line initializers.

Can you provide an example that does not work? Here is a working example:
Code:
Dim bd as ByteVectorData({ 0, 1, _
2, 3, 4, _
5
})
Sub Main()
  Debug.Print CStr(bd(2))
End Sub
Back to top
DH*
Guest





Posted: 07 May 2006, 17:08 PM    Post subject: Reply with quote

Both examples below result in errors. The second is my preferred construction.
Code:
Public months           As New StringVectorData({"JAN","FEB","MAR","APR","MAY","JUN", _
"JUL","AUG","SEP","OCT","NOV","DEC"})

Public months           As New StringVectorData({"JAN","FEB","MAR","APR","MAY","JUN", _
                                                 "JUL","AUG","SEP","OCT","NOV","DEC"})
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 07 May 2006, 18:29 PM    Post subject: Reply with quote

Quote:
Both examples below result in errors.
Thanks. In most cases, having a test case that demonstrates a problem is substantially more useful than a general statement about something not working correctly.

The cause of the problem has been identified and resolved.
Back to top
DH*
Guest





Posted: 07 May 2006, 19:30 PM    Post subject: Reply with quote

dkinzer wrote:
Quote:
Both examples below result in errors.
Thanks. In most cases, having a test case that demonstrates a problem is substantially more useful than a general statement about something not working correctly.

In this case, the example is the same one I gave a couple of weeks ago when I first reported that the underscore didn't work in these block data initializations so I assumed you would recall it.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group