Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
Would you like to see a separate forum on Baanboard for the ION product?
No
14%
Yes
86%
Total votes: 80

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 6th August 2012, 20:17
cherokee's Avatar
cherokee cherokee is offline
Senior Member
 
Join Date: Jan 2003
Location: Montreal, Canada
Posts: 256
cherokee is on a distinguished road
Baan: Baan IVc3 A&D - DB: Oracle - OS: IBM AIX
3GL domain tcdate
Baan: Other/Unknown
C/S: None/Unknown

Hello,

just wondering if it is possible create a field with a domain date(or any other domain) in a 3GL program.

Thanks in advance

Carlos
__________________
Carlos Gonzalez CPIM,CSCP
Reply With Quote
  #2  
Old 7th August 2012, 14:06
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Louisville, KY, USA
Posts: 5,943
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I just tested this and it compiled:
Code:
	domain	tcdate	some.date
function main()
{
	some.date = date.num()
When I ran it in debug it worked.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 7th August 2012, 16:52
cherokee's Avatar
cherokee cherokee is offline
Senior Member
 
Join Date: Jan 2003
Location: Montreal, Canada
Posts: 256
cherokee is on a distinguished road
Baan: Baan IVc3 A&D - DB: Oracle - OS: IBM AIX
Thanks Mark,

I do have fields/vars in my 3GL with diffrent domain types; sorry if I wasn' t clear. I wanted to use it as an entry field on a graphic window or a grid, with a specific domain.

Thanks again.
__________________
Carlos Gonzalez CPIM,CSCP
Reply With Quote
  #4  
Old 7th August 2012, 20:55
steveauckly steveauckly is offline
Senior Member
 
Join Date: Sep 2001
Location: Kansas City, MO, USA
Posts: 163
steveauckly is on a distinguished road
Baan: Baan IVc4 SP26 - DB: Oracle 10g - OS: Windows XP Pro
I didn't think this is possible so I coded my own. Nothing fancy, feel free to use it and improve on it.

Code:
function parse.date.input(ref domain tcdate pass.date, ref long pass.field.obj)
{
   string fld.date.string(21), ls.month(2), ls.year(4)

   get.object(pass.field.obj,DsNstring,fld.date.string)
   on case fld.date.string(1;1)
      case "+":
         pass.date = current.date + lval(fld.date.string(2;20))
         break
      case "-":
         pass.date = current.date - lval(fld.date.string(2;20))
         break
      default:
         ls.month = sprintf$("%D(%02m)", current.date)
         ls.year  = sprintf$("%D(%04Y)", current.date)
         on case len(strip$(fld.date.string))
            case 1:
               fld.date.string = ls.month & "0" & strip$(fld.date.string) &
                                  ls.year
               pass.date = inputstr.to.date(fld.date.string, "%D002")
               break
            case 2:
               fld.date.string = ls.month & strip$(fld.date.string) & ls.year
               pass.date = inputstr.to.date(fld.date.string, "%D002")
               break
            case 4:
               fld.date.string = strip$(fld.date.string) & ls.year
               pass.date = inputstr.to.date(fld.date.string, "%D002")
               break
            case 6:
               fld.date.string = fld.date.string(1;4) & ls.year(1;2) &
                                 fld.date.string(5;2)
               pass.date = inputstr.to.date(fld.date.string, "%D002")
               break
            case 8:
               if fld.date.string(2;1) = "-" then
                  pass.date = inputstr.to.date("0" & fld.date.string(1;1) &
^                                 "0" & fld.date.string(3;1) & fld.date.string(5;4), "%D002")
               else
                  pass.date = inputstr.to.date(fld.date.string(1;8), "%D002")
               endif
               break
            case 9:
               if fld.date.string(3;1) = "-" then
                  pass.date = inputstr.to.date(fld.date.string(1;2) &
                                  "0" & fld.date.string(4;1) & fld.date.string(6;4), "%D002")
               else
                  if fld.date.string(2;1) = "-" then
                     fld.date.string = "0" & fld.date.string(1;1) & fld.date.string(3;2) &
                                       fld.date.string(6;4)
                     pass.date = inputstr.to.date(fld.date.string, "%D002")
                  else
                     ls.message(1) = "Date may be dd, mmdd,mmddyy,mmddyyyy or +/- a number of days."
                     display.msg()
                  endif
               endif
               break
            default:
               ls.message(1) = "Date may be dd, mmdd, mmddyy, mmddyyyy or +/- a number of days."
               display.msg()
               break
         endcase
         break
   endcase
}
Reply With Quote
  #5  
Old 8th August 2012, 14:54
cherokee's Avatar
cherokee cherokee is offline
Senior Member
 
Join Date: Jan 2003
Location: Montreal, Canada
Posts: 256
cherokee is on a distinguished road
Baan: Baan IVc3 A&D - DB: Oracle - OS: IBM AIX
Thank you for sharing your script. I was wondering if I had to wirte all you've written.. .

Thanks again.
__________________
Carlos Gonzalez CPIM,CSCP
Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dal king1980 Tools Development 6 19th March 2010 12:10
Undocumented Functions & Variables george7a Tools Development 79 3rd August 2009 09:58
report print condition Elrodyn Tools Development 3 18th March 2009 10:13
Problem with multi-thread processing gget79 Tools Development 5 9th October 2008 16:51
bshell received SIGTERM manojsharma Tools Development 11 5th June 2008 09:22


All times are GMT +2. The time now is 09:21.


©2001-2013 - Baanboard.com - Baanforums.com