The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 wks.col.setformat uses wrong subformat index

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
AKazak Posted - 09/02/2020 : 2:24:25 PM
OriginPro 2021 (64-bit) Beta 4 9.8.0.138
Windows 7 Pro x64 SP1

Greetings!

I want to set custom date format for a worksheet column and try to understand an example from https://www.originlab.com/doc/LabTalk/ref/Wks-Col-obj#Set_Custom_Date_FormatCustom_Date_FormatDate_Format.2C_Customization:

// Surround non-date characters in specifier by single quotes:
wks.col2.SetFormat(4, 22, yyyy'.'MM'.'dd);


Here subformat is set to 22, but the same page above tells:
quote:
Subformat options as listed in the Display drop-down list of the Worksheet Column Format dialog box (in the Origin GUI, select Format pull-down menu, then select Column ... option to open this dialog). To get the appropriate number of the option you want, simply count down from the top of the list of Display options. Make sure the desired Format has been selected first.


Here is my Display drop-down list:


The Custom Display option has a serial number (from top to bottom) of 24, but not 22.

Does the online help stay behind the Origin development or here is some different logic?

---
Andrey
3   L A T E S T    R E P L I E S    (Newest First)
minimax Posted - 09/22/2020 : 04:19:47 AM
Hi AKazak,

index for 9-2-2020 (Global Custom1) is 20;
index for 09:21:37.0000 (Global Custom2) is 21;
index for Custom is 22;
index for 2020-W36 is 23 (new in Origin 2021);
index for 2020-W36-2 is 24 (new in Origin 2021);

Those 2 is another kind of "custom" format.

To modify those 2 format, go to Tools - Options - Miscellaneous Tab - Custom Dates Formats Group, the 2 editboxes.

AKazak Posted - 09/03/2020 : 01:34:11 AM
quote:
Originally posted by cpyang

Custom is special, so some later implementation inserted some additional entries but Custom=22 must stay the same due to people's existing codes.

CP





So 22 corresponds to Custom Display.
How do I then pick 22nd and 23rd list items from the top, that are "9-2-2020 (Global Custom1)" and "09:21:37.0000 (Global Custom2)"?

---
Andrey
cpyang Posted - 09/02/2020 : 4:15:58 PM
Custom is special, so some later implementation inserted some additional entries but Custom=22 must stay the same due to people's existing codes.

CP


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000