Page History
...
Pos | Name | Type | Description | Default |
---|---|---|---|---|
<0, 1> | Entity ID | Text | ID of the entity to which the time block belongs | "" |
<0, 2> | ID | Text | The unique key ID of the time block used to identify it in other properties, methods, and events | "" |
<0, 3> | Start Date & Time | Decimal | The time block's start date & time in OI internal format | 0.0 |
<0, 4> | End Date & Time | Decimal | The time block's end date & time in OI internal format | 0.0 |
<0, 5> | Back Color | Color | The color of the time block | Select L=90 |
<0, 6> | Fore Color | Color | The color of the time block's text | SelectText |
<0, 7> | Caption | Text | The time block's caption | "" |
...
The TimeBlockList property contains all the time blocks stored in the control. Each field in the list represents a single time block. This property is a replacement to the EntityTimeBlocks property, which wasn't flexible enough for some needs. This property creates time blocks that have the same flexibility as appointments.
A time block is associated to an existing entity by that entity's ID. Therefore, you must call EntityList prior to calling TimeBlockList. The next value is the time blocks's ID.
...
Code Block |
---|
Declare function Min, Max Caption = "Hello, World!" ForeColor = "RGB{255, 255, 255}" // Create random time blocks for the next 30 days TimeBlocks = "" ID = 0 For i = 1 to 30 Count = 0 CurrDate = Date() + i GoSub Get_Random_Data TimeBlocks<-1> = "EntityKey1-1":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption Count = Count + 1; ID = ID + 1 GoSub Get_Random_Data TimeBlocks<-1> = "EntityKey1-2":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption Count = Count + 1; ID = ID + 1 GoSub Get_Random_Data TimeBlocks<-1> = "EntityKey2-1":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption Count = Count + 1; ID = ID + 1 GoSub Get_Random_Data TimeBlocks<-1> = "EntityKey2-1-1":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption Count = Count + 1; ID = ID + 1 GoSub Get_Random_Data TimeBlocks<-1> = "EntityKey2-1-1":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption Count = Count + 1; ID = ID + 1 GoSub Get_Random_Data TimeBlocks<-1> = "EntityKey2-1-2":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption Count = Count + 1; ID = ID + 1 GoSub Get_Random_Data TimeBlocks<-1> = "EntityKey2-1-2":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption Count = Count + 1; ID = ID + 1 GoSub Get_Random_Data Next i // Add the time blocks Set_Property(@Window:".OLE_SCHEDULE", "OLE.TimeBlockList", TimeBlocks) Get_Random_Data: // Generate random times Time1 = Rnd( 48 ) * 1800 Time2 = Rnd( 48 ) * 1800 // Convert to OI Internal DT format StartTime = IConv(OConv(CurrDate - Rnd(2), "D4/") : " " : OConv(Min(Time1, Time2), "MTS"), "DT") EndTime = IConv(OConv(CurrDate, "D4/") : " " : OConv(Max(Time1, Time2), "MTS"), "DT") // Generate random back color BackColorHue = Rnd(256) BackColor = "HSL{":BackColorHue:", 127, 45}" return |