From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/00000002.xhp | 66 + .../source/text/sbasic/shared/00000003.xhp | 347 +++++ .../source/text/sbasic/shared/01/06130000.xhp | 80 + .../source/text/sbasic/shared/01/06130100.xhp | 42 + .../source/text/sbasic/shared/01/06130500.xhp | 49 + .../source/text/sbasic/shared/01000000.xhp | 44 + .../source/text/sbasic/shared/01010210.xhp | 58 + .../source/text/sbasic/shared/01020000.xhp | 44 + .../source/text/sbasic/shared/01020100.xhp | 201 +++ .../source/text/sbasic/shared/01020200.xhp | 46 + .../source/text/sbasic/shared/01020300.xhp | 164 ++ .../source/text/sbasic/shared/01020500.xhp | 49 + .../source/text/sbasic/shared/01030000.xhp | 46 + .../source/text/sbasic/shared/01030100.xhp | 45 + .../source/text/sbasic/shared/01030200.xhp | 86 ++ .../source/text/sbasic/shared/01030300.xhp | 63 + .../source/text/sbasic/shared/01030400.xhp | 211 +++ .../source/text/sbasic/shared/01040000.xhp | 227 +++ .../source/text/sbasic/shared/01050000.xhp | 65 + .../source/text/sbasic/shared/01050100.xhp | 60 + .../source/text/sbasic/shared/01050200.xhp | 39 + .../source/text/sbasic/shared/01050300.xhp | 58 + .../source/text/sbasic/shared/01170100.xhp | 104 ++ .../source/text/sbasic/shared/01170101.xhp | 444 ++++++ .../source/text/sbasic/shared/01170103.xhp | 66 + .../source/text/sbasic/shared/02/11010000.xhp | 58 + .../source/text/sbasic/shared/02/11020000.xhp | 55 + .../source/text/sbasic/shared/02/11030000.xhp | 54 + .../source/text/sbasic/shared/02/11040000.xhp | 57 + .../source/text/sbasic/shared/02/11050000.xhp | 58 + .../source/text/sbasic/shared/02/11060000.xhp | 58 + .../source/text/sbasic/shared/02/11070000.xhp | 53 + .../source/text/sbasic/shared/02/11080000.xhp | 56 + .../source/text/sbasic/shared/02/11090000.xhp | 61 + .../source/text/sbasic/shared/02/11100000.xhp | 55 + .../source/text/sbasic/shared/02/11110000.xhp | 55 + .../source/text/sbasic/shared/02/11120000.xhp | 55 + .../source/text/sbasic/shared/02/11140000.xhp | 55 + .../source/text/sbasic/shared/02/11150000.xhp | 54 + .../source/text/sbasic/shared/02/11160000.xhp | 55 + .../source/text/sbasic/shared/02/11170000.xhp | 54 + .../source/text/sbasic/shared/02/11180000.xhp | 63 + .../source/text/sbasic/shared/02/11190000.xhp | 51 + .../source/text/sbasic/shared/02/20000000.xhp | 506 +++++++ .../source/text/sbasic/shared/03/lib_depot.xhp | 28 + .../source/text/sbasic/shared/03/lib_euro.xhp | 30 + .../text/sbasic/shared/03/lib_formwizard.xhp | 28 + .../source/text/sbasic/shared/03/lib_gimmicks.xhp | 30 + .../source/text/sbasic/shared/03/lib_schedule.xhp | 30 + .../source/text/sbasic/shared/03/lib_script.xhp | 30 + .../source/text/sbasic/shared/03/lib_template.xhp | 28 + .../source/text/sbasic/shared/03/lib_tools.xhp | 1600 ++++++++++++++++++++ .../source/text/sbasic/shared/03000000.xhp | 51 + .../source/text/sbasic/shared/03010000.xhp | 41 + .../source/text/sbasic/shared/03010100.xhp | 43 + .../source/text/sbasic/shared/03010101.xhp | 223 +++ .../source/text/sbasic/shared/03010102.xhp | 320 ++++ .../source/text/sbasic/shared/03010103.xhp | 90 ++ .../source/text/sbasic/shared/03010200.xhp | 41 + .../source/text/sbasic/shared/03010201.xhp | 68 + .../source/text/sbasic/shared/03010300.xhp | 45 + .../source/text/sbasic/shared/03010301.xhp | 68 + .../source/text/sbasic/shared/03010302.xhp | 68 + .../source/text/sbasic/shared/03010303.xhp | 71 + .../source/text/sbasic/shared/03010304.xhp | 80 + .../source/text/sbasic/shared/03010305.xhp | 71 + .../source/text/sbasic/shared/03020000.xhp | 42 + .../source/text/sbasic/shared/03020100.xhp | 41 + .../source/text/sbasic/shared/03020101.xhp | 77 + .../source/text/sbasic/shared/03020102.xhp | 83 + .../source/text/sbasic/shared/03020103.xhp | 81 + .../source/text/sbasic/shared/03020104.xhp | 76 + .../source/text/sbasic/shared/03020200.xhp | 46 + .../source/text/sbasic/shared/03020201.xhp | 84 + .../source/text/sbasic/shared/03020202.xhp | 90 ++ .../source/text/sbasic/shared/03020203.xhp | 78 + .../source/text/sbasic/shared/03020204.xhp | 85 ++ .../source/text/sbasic/shared/03020205.xhp | 73 + .../source/text/sbasic/shared/03020301.xhp | 83 + .../source/text/sbasic/shared/03020302.xhp | 54 + .../source/text/sbasic/shared/03020303.xhp | 81 + .../source/text/sbasic/shared/03020304.xhp | 52 + .../source/text/sbasic/shared/03020305.xhp | 53 + .../source/text/sbasic/shared/03020400.xhp | 56 + .../source/text/sbasic/shared/03020401.xhp | 71 + .../source/text/sbasic/shared/03020402.xhp | 63 + .../source/text/sbasic/shared/03020403.xhp | 74 + .../source/text/sbasic/shared/03020404.xhp | 85 ++ .../source/text/sbasic/shared/03020405.xhp | 83 + .../source/text/sbasic/shared/03020406.xhp | 62 + .../source/text/sbasic/shared/03020407.xhp | 61 + .../source/text/sbasic/shared/03020408.xhp | 63 + .../source/text/sbasic/shared/03020409.xhp | 169 +++ .../source/text/sbasic/shared/03020410.xhp | 60 + .../source/text/sbasic/shared/03020411.xhp | 101 ++ .../source/text/sbasic/shared/03020412.xhp | 65 + .../source/text/sbasic/shared/03020413.xhp | 65 + .../source/text/sbasic/shared/03020414.xhp | 122 ++ .../source/text/sbasic/shared/03020415.xhp | 64 + .../source/text/sbasic/shared/03030000.xhp | 44 + .../source/text/sbasic/shared/03030100.xhp | 53 + .../source/text/sbasic/shared/03030101.xhp | 70 + .../source/text/sbasic/shared/03030102.xhp | 57 + .../source/text/sbasic/shared/03030103.xhp | 62 + .../source/text/sbasic/shared/03030104.xhp | 62 + .../source/text/sbasic/shared/03030105.xhp | 73 + .../source/text/sbasic/shared/03030106.xhp | 62 + .../source/text/sbasic/shared/03030107.xhp | 62 + .../source/text/sbasic/shared/03030108.xhp | 60 + .../source/text/sbasic/shared/03030110.xhp | 157 ++ .../source/text/sbasic/shared/03030111.xhp | 63 + .../source/text/sbasic/shared/03030112.xhp | 63 + .../source/text/sbasic/shared/03030113.xhp | 63 + .../source/text/sbasic/shared/03030114.xhp | 63 + .../source/text/sbasic/shared/03030115.xhp | 62 + .../source/text/sbasic/shared/03030116.xhp | 62 + .../source/text/sbasic/shared/03030120.xhp | 187 +++ .../source/text/sbasic/shared/03030130.xhp | 63 + .../source/text/sbasic/shared/03030200.xhp | 49 + .../source/text/sbasic/shared/03030201.xhp | 56 + .../source/text/sbasic/shared/03030202.xhp | 56 + .../source/text/sbasic/shared/03030203.xhp | 56 + .../source/text/sbasic/shared/03030204.xhp | 65 + .../source/text/sbasic/shared/03030205.xhp | 76 + .../source/text/sbasic/shared/03030206.xhp | 78 + .../source/text/sbasic/shared/03030300.xhp | 44 + .../source/text/sbasic/shared/03030301.xhp | 57 + .../source/text/sbasic/shared/03030302.xhp | 56 + .../source/text/sbasic/shared/03030303.xhp | 63 + .../source/text/sbasic/shared/03040000.xhp | 356 +++++ .../source/text/sbasic/shared/03050000.xhp | 44 + .../source/text/sbasic/shared/03050100.xhp | 70 + .../source/text/sbasic/shared/03050200.xhp | 66 + .../source/text/sbasic/shared/03050300.xhp | 55 + .../source/text/sbasic/shared/03050500.xhp | 89 ++ .../source/text/sbasic/shared/03060000.xhp | 47 + .../source/text/sbasic/shared/03060100.xhp | 68 + .../source/text/sbasic/shared/03060200.xhp | 67 + .../source/text/sbasic/shared/03060300.xhp | 67 + .../source/text/sbasic/shared/03060400.xhp | 66 + .../source/text/sbasic/shared/03060500.xhp | 67 + .../source/text/sbasic/shared/03060600.xhp | 67 + .../source/text/sbasic/shared/03070000.xhp | 47 + .../source/text/sbasic/shared/03070100.xhp | 66 + .../source/text/sbasic/shared/03070200.xhp | 66 + .../source/text/sbasic/shared/03070300.xhp | 66 + .../source/text/sbasic/shared/03070400.xhp | 66 + .../source/text/sbasic/shared/03070500.xhp | 60 + .../source/text/sbasic/shared/03070600.xhp | 66 + .../source/text/sbasic/shared/03080000.xhp | 48 + .../source/text/sbasic/shared/03080100.xhp | 44 + .../source/text/sbasic/shared/03080101.xhp | 70 + .../source/text/sbasic/shared/03080102.xhp | 74 + .../source/text/sbasic/shared/03080103.xhp | 75 + .../source/text/sbasic/shared/03080104.xhp | 75 + .../source/text/sbasic/shared/03080200.xhp | 42 + .../source/text/sbasic/shared/03080201.xhp | 64 + .../source/text/sbasic/shared/03080202.xhp | 69 + .../source/text/sbasic/shared/03080300.xhp | 42 + .../source/text/sbasic/shared/03080301.xhp | 74 + .../source/text/sbasic/shared/03080302.xhp | 76 + .../source/text/sbasic/shared/03080400.xhp | 41 + .../source/text/sbasic/shared/03080401.xhp | 65 + .../source/text/sbasic/shared/03080500.xhp | 43 + .../source/text/sbasic/shared/03080501.xhp | 64 + .../source/text/sbasic/shared/03080502.xhp | 66 + .../source/text/sbasic/shared/03080503.xhp | 47 + .../source/text/sbasic/shared/03080600.xhp | 41 + .../source/text/sbasic/shared/03080601.xhp | 67 + .../source/text/sbasic/shared/03080700.xhp | 41 + .../source/text/sbasic/shared/03080701.xhp | 100 ++ .../source/text/sbasic/shared/03080800.xhp | 42 + .../source/text/sbasic/shared/03080801.xhp | 78 + .../source/text/sbasic/shared/03080802.xhp | 62 + .../source/text/sbasic/shared/03090000.xhp | 45 + .../source/text/sbasic/shared/03090100.xhp | 43 + .../source/text/sbasic/shared/03090101.xhp | 74 + .../source/text/sbasic/shared/03090102.xhp | 71 + .../source/text/sbasic/shared/03090103.xhp | 51 + .../source/text/sbasic/shared/03090200.xhp | 43 + .../source/text/sbasic/shared/03090201.xhp | 103 ++ .../source/text/sbasic/shared/03090202.xhp | 124 ++ .../source/text/sbasic/shared/03090203.xhp | 58 + .../source/text/sbasic/shared/03090300.xhp | 43 + .../source/text/sbasic/shared/03090301.xhp | 91 ++ .../source/text/sbasic/shared/03090302.xhp | 71 + .../source/text/sbasic/shared/03090303.xhp | 84 + .../source/text/sbasic/shared/03090400.xhp | 50 + .../source/text/sbasic/shared/03090401.xhp | 64 + .../source/text/sbasic/shared/03090402.xhp | 69 + .../source/text/sbasic/shared/03090403.xhp | 71 + .../source/text/sbasic/shared/03090404.xhp | 77 + .../source/text/sbasic/shared/03090405.xhp | 64 + .../source/text/sbasic/shared/03090406.xhp | 98 ++ .../source/text/sbasic/shared/03090407.xhp | 61 + .../source/text/sbasic/shared/03090408.xhp | 55 + .../source/text/sbasic/shared/03090409.xhp | 64 + .../source/text/sbasic/shared/03090410.xhp | 68 + .../source/text/sbasic/shared/03090411.xhp | 48 + .../source/text/sbasic/shared/03090412.xhp | 87 ++ .../source/text/sbasic/shared/03090413.xhp | 69 + .../source/text/sbasic/shared/03100000.xhp | 91 ++ .../source/text/sbasic/shared/03100050.xhp | 48 + .../source/text/sbasic/shared/03100060.xhp | 48 + .../source/text/sbasic/shared/03100070.xhp | 48 + .../source/text/sbasic/shared/03100080.xhp | 50 + .../source/text/sbasic/shared/03100100.xhp | 72 + .../source/text/sbasic/shared/03100300.xhp | 64 + .../source/text/sbasic/shared/03100400.xhp | 64 + .../source/text/sbasic/shared/03100500.xhp | 56 + .../source/text/sbasic/shared/03100600.xhp | 56 + .../source/text/sbasic/shared/03100700.xhp | 61 + .../source/text/sbasic/shared/03100900.xhp | 65 + .../source/text/sbasic/shared/03101000.xhp | 115 ++ .../source/text/sbasic/shared/03101100.xhp | 72 + .../source/text/sbasic/shared/03101110.xhp | 51 + .../source/text/sbasic/shared/03101120.xhp | 51 + .../source/text/sbasic/shared/03101130.xhp | 51 + .../source/text/sbasic/shared/03101140.xhp | 51 + .../source/text/sbasic/shared/03101300.xhp | 50 + .../source/text/sbasic/shared/03101400.xhp | 50 + .../source/text/sbasic/shared/03101500.xhp | 50 + .../source/text/sbasic/shared/03101600.xhp | 50 + .../source/text/sbasic/shared/03101700.xhp | 45 + .../source/text/sbasic/shared/03102000.xhp | 69 + .../source/text/sbasic/shared/03102100.xhp | 158 ++ .../source/text/sbasic/shared/03102101.xhp | 67 + .../source/text/sbasic/shared/03102200.xhp | 63 + .../source/text/sbasic/shared/03102300.xhp | 66 + .../source/text/sbasic/shared/03102400.xhp | 64 + .../source/text/sbasic/shared/03102450.xhp | 50 + .../source/text/sbasic/shared/03102600.xhp | 65 + .../source/text/sbasic/shared/03102700.xhp | 66 + .../source/text/sbasic/shared/03102800.xhp | 68 + .../source/text/sbasic/shared/03102900.xhp | 70 + .../source/text/sbasic/shared/03103000.xhp | 73 + .../source/text/sbasic/shared/03103100.xhp | 63 + .../source/text/sbasic/shared/03103200.xhp | 54 + .../source/text/sbasic/shared/03103300.xhp | 57 + .../source/text/sbasic/shared/03103350.xhp | 69 + .../source/text/sbasic/shared/03103400.xhp | 56 + .../source/text/sbasic/shared/03103450.xhp | 56 + .../source/text/sbasic/shared/03103500.xhp | 71 + .../source/text/sbasic/shared/03103600.xhp | 277 ++++ .../source/text/sbasic/shared/03103700.xhp | 73 + .../source/text/sbasic/shared/03103800.xhp | 68 + .../source/text/sbasic/shared/03103900.xhp | 56 + .../source/text/sbasic/shared/03104000.xhp | 52 + .../source/text/sbasic/shared/03104100.xhp | 50 + .../source/text/sbasic/shared/03104200.xhp | 53 + .../source/text/sbasic/shared/03104300.xhp | 54 + .../source/text/sbasic/shared/03104400.xhp | 53 + .../source/text/sbasic/shared/03104500.xhp | 63 + .../source/text/sbasic/shared/03104600.xhp | 54 + .../source/text/sbasic/shared/03104700.xhp | 64 + .../source/text/sbasic/shared/03110000.xhp | 41 + .../source/text/sbasic/shared/03110100.xhp | 76 + .../source/text/sbasic/shared/03120000.xhp | 45 + .../source/text/sbasic/shared/03120100.xhp | 45 + .../source/text/sbasic/shared/03120101.xhp | 69 + .../source/text/sbasic/shared/03120102.xhp | 68 + .../source/text/sbasic/shared/03120103.xhp | 67 + .../source/text/sbasic/shared/03120104.xhp | 64 + .../source/text/sbasic/shared/03120105.xhp | 51 + .../source/text/sbasic/shared/03120111.xhp | 68 + .../source/text/sbasic/shared/03120112.xhp | 68 + .../source/text/sbasic/shared/03120200.xhp | 42 + .../source/text/sbasic/shared/03120201.xhp | 67 + .../source/text/sbasic/shared/03120202.xhp | 68 + .../source/text/sbasic/shared/03120300.xhp | 54 + .../source/text/sbasic/shared/03120301.xhp | 99 ++ .../source/text/sbasic/shared/03120302.xhp | 64 + .../source/text/sbasic/shared/03120303.xhp | 72 + .../source/text/sbasic/shared/03120304.xhp | 81 + .../source/text/sbasic/shared/03120305.xhp | 72 + .../source/text/sbasic/shared/03120306.xhp | 76 + .../source/text/sbasic/shared/03120307.xhp | 73 + .../source/text/sbasic/shared/03120308.xhp | 83 + .../source/text/sbasic/shared/03120309.xhp | 72 + .../source/text/sbasic/shared/03120310.xhp | 62 + .../source/text/sbasic/shared/03120311.xhp | 71 + .../source/text/sbasic/shared/03120312.xhp | 60 + .../source/text/sbasic/shared/03120313.xhp | 51 + .../source/text/sbasic/shared/03120314.xhp | 101 ++ .../source/text/sbasic/shared/03120315.xhp | 53 + .../source/text/sbasic/shared/03120400.xhp | 43 + .../source/text/sbasic/shared/03120401.xhp | 71 + .../source/text/sbasic/shared/03120402.xhp | 59 + .../source/text/sbasic/shared/03120403.xhp | 81 + .../source/text/sbasic/shared/03120411.xhp | 76 + .../source/text/sbasic/shared/03120412.xhp | 57 + .../source/text/sbasic/shared/03130000.xhp | 50 + .../source/text/sbasic/shared/03130100.xhp | 54 + .../source/text/sbasic/shared/03130500.xhp | 130 ++ .../source/text/sbasic/shared/03130600.xhp | 60 + .../source/text/sbasic/shared/03130610.xhp | 51 + .../source/text/sbasic/shared/03130700.xhp | 61 + .../source/text/sbasic/shared/03130800.xhp | 65 + .../source/text/sbasic/shared/03131000.xhp | 57 + .../source/text/sbasic/shared/03131300.xhp | 55 + .../source/text/sbasic/shared/03131400.xhp | 55 + .../source/text/sbasic/shared/03131500.xhp | 49 + .../source/text/sbasic/shared/03131600.xhp | 85 ++ .../source/text/sbasic/shared/03131700.xhp | 50 + .../source/text/sbasic/shared/03131800.xhp | 54 + .../source/text/sbasic/shared/03131900.xhp | 64 + .../source/text/sbasic/shared/03132000.xhp | 131 ++ .../source/text/sbasic/shared/03132100.xhp | 56 + .../source/text/sbasic/shared/03132200.xhp | 49 + .../source/text/sbasic/shared/03132300.xhp | 47 + .../source/text/sbasic/shared/03132400.xhp | 52 + .../source/text/sbasic/shared/03132500.xhp | 41 + .../source/text/sbasic/shared/03140000.xhp | 71 + .../source/text/sbasic/shared/03140001.xhp | 72 + .../source/text/sbasic/shared/03140002.xhp | 73 + .../source/text/sbasic/shared/03140003.xhp | 73 + .../source/text/sbasic/shared/03140004.xhp | 74 + .../source/text/sbasic/shared/03140005.xhp | 74 + .../source/text/sbasic/shared/03140006.xhp | 77 + .../source/text/sbasic/shared/03140007.xhp | 76 + .../source/text/sbasic/shared/03140008.xhp | 82 + .../source/text/sbasic/shared/03140009.xhp | 76 + .../source/text/sbasic/shared/03140010.xhp | 77 + .../source/text/sbasic/shared/03140011.xhp | 72 + .../source/text/sbasic/shared/03140012.xhp | 74 + .../source/text/sbasic/shared/03150000.xhp | 140 ++ .../source/text/sbasic/shared/03150001.xhp | 173 +++ .../source/text/sbasic/shared/03150002.xhp | 66 + .../source/text/sbasic/shared/03160000.xhp | 77 + .../source/text/sbasic/shared/03170000.xhp | 71 + .../source/text/sbasic/shared/03170010.xhp | 118 ++ .../source/text/sbasic/shared/05060700.xhp | 372 +++++ helpcontent2/source/text/sbasic/shared/ErrVBA.xhp | 129 ++ .../source/text/sbasic/shared/GetPathSeparator.xhp | 64 + helpcontent2/source/text/sbasic/shared/Resume.xhp | 77 + .../source/text/sbasic/shared/calc_functions.xhp | 865 +++++++++++ .../source/text/sbasic/shared/classmodule.xhp | 63 + .../source/text/sbasic/shared/code-stubs.xhp | 58 + .../text/sbasic/shared/compatibilitymode.xhp | 76 + .../source/text/sbasic/shared/compatible.xhp | 66 + helpcontent2/source/text/sbasic/shared/enum.xhp | 70 + .../source/text/sbasic/shared/fragments.xhp | 70 + helpcontent2/source/text/sbasic/shared/keys.xhp | 110 ++ .../source/text/sbasic/shared/main0211.xhp | 76 + .../source/text/sbasic/shared/main0601.xhp | 71 + .../source/text/sbasic/shared/partition.xhp | 60 + .../source/text/sbasic/shared/property.xhp | 126 ++ helpcontent2/source/text/sbasic/shared/replace.xhp | 54 + .../source/text/sbasic/shared/special_vba_func.xhp | 127 ++ .../source/text/sbasic/shared/stardesktop.xhp | 38 + .../source/text/sbasic/shared/uno_objects.xhp | 46 + .../source/text/sbasic/shared/vbasupport.xhp | 54 + 352 files changed, 28265 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/00000002.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/00000003.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01/06130000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01/06130100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01/06130500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01000000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01010210.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01020000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01020100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01020200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01020300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01020500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01030000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01030100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01030200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01030300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01030400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01040000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01050000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01050100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01050200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01050300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01170100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01170101.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/01170103.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11010000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11020000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11030000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11040000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11050000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11060000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11070000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11080000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11090000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11100000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11110000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11120000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11140000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11150000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11160000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11170000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11180000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/11190000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/02/20000000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03/lib_depot.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03/lib_euro.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03/lib_formwizard.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03/lib_gimmicks.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03/lib_schedule.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03/lib_script.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03/lib_template.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03/lib_tools.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03000000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010101.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010102.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010103.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010201.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010301.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010302.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010303.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010304.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03010305.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020101.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020102.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020103.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020104.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020201.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020202.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020203.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020204.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020205.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020301.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020302.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020303.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020304.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020305.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020401.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020402.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020403.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020404.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020405.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020406.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020407.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020408.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020409.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020410.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020411.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020412.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020413.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020414.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03020415.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030101.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030102.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030103.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030104.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030105.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030106.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030107.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030108.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030110.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030111.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030112.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030113.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030114.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030115.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030116.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030120.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030130.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030201.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030202.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030203.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030204.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030205.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030206.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030301.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030302.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03030303.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03040000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03050000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03050100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03050200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03050300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03050500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03060000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03060100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03060200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03060300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03060400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03060500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03060600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03070000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03070100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03070200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03070300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03070400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03070500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03070600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080101.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080102.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080103.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080104.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080201.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080202.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080301.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080302.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080401.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080501.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080502.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080503.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080601.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080700.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080701.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080800.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080801.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03080802.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090101.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090102.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090103.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090201.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090202.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090203.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090301.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090302.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090303.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090401.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090402.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090403.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090404.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090405.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090406.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090407.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090408.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090409.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090410.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090411.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090412.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03090413.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100050.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100060.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100070.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100080.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100700.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03100900.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101110.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101120.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101130.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101140.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03101700.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102101.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102450.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102700.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102800.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03102900.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103350.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103450.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103700.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103800.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03103900.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03104000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03104100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03104200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03104300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03104400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03104500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03104600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03104700.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03110000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03110100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120101.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120102.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120103.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120104.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120105.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120111.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120112.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120201.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120202.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120301.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120302.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120303.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120304.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120305.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120306.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120307.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120308.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120309.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120310.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120311.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120312.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120313.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120314.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120315.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120401.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120402.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120403.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120411.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03120412.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03130000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03130100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03130500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03130600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03130610.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03130700.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03130800.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03131000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03131300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03131400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03131500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03131600.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03131700.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03131800.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03131900.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03132000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03132100.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03132200.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03132300.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03132400.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03132500.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140001.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140002.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140003.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140004.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140005.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140006.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140007.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140008.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140009.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140010.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140011.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03140012.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03150000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03150001.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03150002.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03160000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03170000.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/03170010.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/05060700.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/ErrVBA.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/GetPathSeparator.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/Resume.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/calc_functions.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/classmodule.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/code-stubs.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/compatibilitymode.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/compatible.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/enum.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/fragments.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/keys.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/main0211.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/main0601.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/partition.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/property.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/replace.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/special_vba_func.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/stardesktop.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/uno_objects.xhp create mode 100644 helpcontent2/source/text/sbasic/shared/vbasupport.xhp (limited to 'helpcontent2/source/text/sbasic/shared') diff --git a/helpcontent2/source/text/sbasic/shared/00000002.xhp b/helpcontent2/source/text/sbasic/shared/00000002.xhp new file mode 100644 index 000000000..bfdfc2aaf --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/00000002.xhp @@ -0,0 +1,66 @@ + + + + + + + + +$[officename] Basic Glossary +/text/sbasic/shared/00000002.xhp + + +Sun Microsystems, Inc. + + + +$[officename] Basic Glossary +This glossary explains some technical terms that you may come across when working with $[officename] Basic. + +
+Decimal Point +When converting numbers, $[officename] Basic uses the locale settings of the system for determining the type of decimal and thousand separator. +The behavior has an effect on both the implicit conversion ( 1 + "2.3" = 3.3 ) as well as the function IsNumeric. +
+
+Colors +In $[officename] Basic, colors are treated as long integer value. The return value of color queries is also always a long integer value. When defining properties, colors can be specified using their RGB code that is converted to a long integer value using the RGB function. +
+
+Measurement Units +In $[officename] Basic, a method parameter or a property expecting unit information can be specified either as integer or long integer expression without a unit, or as a character string containing a unit. If no unit is passed to the method the default unit defined for the active document type will be used. If the parameter is passed as a character string containing a measurement unit, the default setting will be ignored. The default measurement unit for a document type can be set under %PRODUCTNAME - PreferencesTools - Options - (Document Type) - General. +
+
+twips; definition + +Twips +A twip is a screen-independent unit which is used to define the uniform position and size of screen elements on all display systems. A twip is 1/1440th of an inch or 1/20 of a printer's point. There are 1440 twips to an inch or about 567 twips to a centimeter. +
+
+URL Notation +URLs (Uniform Resource Locators) are used to determine the location of a resource like a file in a file system, typically inside a network environment. A URL consists of a protocol specifier, a host specifier and a file and path specifier: + +protocol://host.name/path/to/the/file.html + +The most common usage of URLs is on the internet when specifying web pages. Example for protocols are http, ftp, or file. The file protocol specifier is used when referring to a file on the local file system. +URL notation does not allow certain special characters to be used. These are either replaced by other characters or encoded. A slash (/) is used as a path separator. For example, a file referred to as C:\Users\alice\Documents\My File.odt on the local host in "Windows notation" becomes file:///C:/Users/alice/Documents/My%20File.odt in URL notation. +
+
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/00000003.xhp b/helpcontent2/source/text/sbasic/shared/00000003.xhp new file mode 100644 index 000000000..efa7db761 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/00000003.xhp @@ -0,0 +1,347 @@ + + + + + + + Information + /text/sbasic/shared/00000003.xhp + + + + + + +

Information

+ +
+You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in %PRODUCTNAME - Preferences +Tools - Options - Language Settings - Languages. In Basic format codes, the decimal point (.) is always used as placeholder for the decimal separator defined in your locale and will be replaced by the corresponding character. +The same applies to the locale settings for date, time and currency formats. The Basic format code will be interpreted and displayed according to your locale setting. +
+ +
+The color values of the 16 basic colors are as follows: + + + + + Color Value + + + Color Name + + + + + 0 + + + Black + + + + + 128 + + + Blue + + + + + 32768 + + + Green + + + + + 32896 + + + Cyan + + + + + 8388608 + + + Red + + + + + 8388736 + + + Magenta + + + + + 8421376 + + + Yellow + + + + + 8421504 + + + White + + + + + 12632256 + + + Gray + + + + + 255 + + + Light blue + + + + + 65280 + + + Light green + + + + + 65535 + + + Light cyan + + + + + 16711680 + + + Light red + + + + + 16711935 + + + Light magenta + + + + + 16776960 + + + Light yellow + + + + + 16777215 + + + Transparent white + + +
+
+ +
+ Open Tools - Macros - %PRODUCTNAME Basic - Edit and select %PRODUCTNAME Macros container. +
+
+ This library must be loaded before execution. Place the following statement before the first macro in your module: +
+ +
+ This constant, function or object is enabled with the statement Option VBASupport 1 placed before the executable program code in a module. +
+
+ This statement must be added before the executable program code in a module. +
+ +
+

Syntax:

+
+ +
+

Return value:

+
+ +
+

Parameters:

+
+ +
+

Example:

+
+ +VBA financial functions +VBA Time and Date functions +VBA I/O functions +VBA Mathematical functions +VBA Object functions + +
+

Error codes:

+
+ +
+1 An exception occurred +2 Syntax error +3 Return without Gosub +4 Incorrect entry; please retry +5 Invalid procedure call +6 Overflow +7 Not enough memory +8 Array already dimensioned +9 Index out of defined range +10 Duplicate definition +11 Division by zero +12 Variable not defined +13 Data type mismatch +14 Invalid parameter +18 Process interrupted by user +20 Resume without error +28 Not enough stack memory +35 Sub-procedure or function procedure not defined +48 Error loading DLL file +49 Wrong DLL call convention +51 Internal error +52 Invalid file name or file number +53 File not found +54 Incorrect file mode +55 File already open +57 Device I/O error +58 File already exists +59 Incorrect record length +61 Disk or hard drive full +62 Reading exceeds EOF +63 Incorrect record number +67 Too many files +68 Device not available +70 Access denied +71 Disk not ready +73 Not implemented +74 Renaming on different drives impossible +75 Path/file access error +76 Path not found +91 Object variable not set +93 Invalid string pattern +94 Use of zero not permitted +250 DDE Error +280 Awaiting response to DDE connection +281 No DDE channels available +282 No application responded to DDE connect initiation +283 Too many applications responded to DDE connect initiation +284 DDE channel locked +285 External application cannot execute DDE operation +286 Timeout while waiting for DDE response +287 user pressed ESCAPE during DDE operation +288 External application busy +289 DDE operation without data +290 Data are in wrong format +291 External application has been terminated +292 DDE connection interrupted or modified +293 DDE method invoked with no channel open +294 Invalid DDE link format +295 DDE message has been lost +296 Paste link already performed +297 Link mode cannot be set due to invalid link topic +298 DDE requires the DDEML.DLL file +323 Module cannot be loaded; invalid format +341 Invalid object index +366 Object is not available +380 Incorrect property value +382 This property is read-only +394 This property is write-only +420 Invalid object reference +423 Property or method not found +424 Object required +425 Invalid use of an object +430 OLE Automation is not supported by this object +438 This property or method is not supported by the object +440 OLE automation error +445 This action is not supported by given object +446 Named arguments are not supported by given object +447 The current locale setting is not supported by the given object +448 Named argument not found +449 Argument is not optional +450 Invalid number of arguments +451 Object is not a list +452 Invalid ordinal number +453 Specified DLL function not found +460 Invalid clipboard format +951 Unexpected symbol: +952 Expected: +953 Symbol expected +954 Variable expected +955 Label expected +956 Value cannot be applied +957 Variable already defined +958 Sub procedure or function procedure already defined +959 Label already defined +960 Variable not found +961 Array or procedure not found +962 Procedure not found +963 Label undefined +964 Unknown data type +965 Exit expected +966 Statement block still open: missing +967 Parentheses do not match +968 Symbol already defined differently +969 Parameters do not correspond to procedure +970 Invalid character in number +971 Array must be dimensioned +972 Else/Endif without If +973 not allowed within a procedure +974 not allowed outside a procedure +975 Dimension specifications do not match +976 Unknown option: +977 Constant redefined +978 Program too large +979 Strings or arrays not permitted +1000 Object does not have this property +1001 Object does not have this method +1002 Required argument lacking +1003 Invalid number of arguments +1004 Error executing a method +1005 Unable to set property +1006 Unable to determine property +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/01/06130000.xhp b/helpcontent2/source/text/sbasic/shared/01/06130000.xhp new file mode 100644 index 000000000..5bf476bff --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01/06130000.xhp @@ -0,0 +1,80 @@ + + + + + + + + +Macro +/text/sbasic/shared/01/06130000.xhp + + +Sun Microsystems, Inc. + + + +macros; Basic IDE +Basic IDE; macros +this file needs more work, see i62546 +Macro +Opens the Macro dialog, where you can create, edit, organize, and run $[officename] Basic macros. +Macro name +Displays the name of the selected macro. To create or to change the name of a macro, enter a name here. +Macro from / Save macro in +Lists the libraries and the modules where you can open or save your macros. To save a macro with a particular document, open the document, and then open this dialog. +Run / Save +Runs or saves the current macro. +Assign +Opens the Customize dialog, where you can assign the selected macro to a menu command, a toolbar, or an event. +Edit +Starts the $[officename] Basic editor and opens the selected macro for editing. +New/Delete +Creates a new macro, or deletes the selected macro. +To create a new macro, select the "Standard" module in the Macro from list, and then click New. +To delete a macro, select it, and then click Delete. +Organizer +Opens the Macro Organizer dialog, where you can add, edit, or delete existing macro modules, dialogs, and libraries. +Module/Dialog +Lists the existing macros and dialogs. +You can drag-and-drop a module or a dialog between libraries. +To copy a dialog or a module, hold down the CommandCtrl key while you drag-and-drop. +Edit +Opens the selected macro or dialog for editing. +New +Creates a new module. +Creates a new dialog. +Libraries tab page +Lets you manage the macro libraries. +Location +Select the location containing the macro libraries that you want to organize. +Library +Lists the macro libraries in the chosen location. +Edit +Opens the $[officename] Basic editor so that you can modify the selected library. +Password +Assigns or edits the password for the selected library. "Standard" libraries cannot have a password. +New +Creates a new library. +Name +Enter a name for the new module, dialog, or library. +Append +Locate that $[officename] Basic library that you want to add to the current list, and then click Open. + + diff --git a/helpcontent2/source/text/sbasic/shared/01/06130100.xhp b/helpcontent2/source/text/sbasic/shared/01/06130100.xhp new file mode 100644 index 000000000..3ccfab746 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01/06130100.xhp @@ -0,0 +1,42 @@ + + + + + + + + + + +Change Password +/text/sbasic/shared/01/06130100.xhp + + +Change Password +Protects the selected library with a password. You can enter a new password, or change the current password. +Old password +Password +Enter the current password for the selected library. +New password +Password +Enter a new password for the selected library. +Confirm +Repeat the new password for the selected library.i66515 + + diff --git a/helpcontent2/source/text/sbasic/shared/01/06130500.xhp b/helpcontent2/source/text/sbasic/shared/01/06130500.xhp new file mode 100644 index 000000000..d7d978604 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01/06130500.xhp @@ -0,0 +1,49 @@ + + + + + + + + + + +Append libraries +/text/sbasic/shared/01/06130500.xhp + + + + + +libraries; adding +inserting;Basic libraries + + Append libraries + Locate that %PRODUCTNAME Basic library that you want to add to the current list, and then click Open. + + + File name: + Enter a name or the path to the library that you want to append. You can also select a library from the list. + Options + Insert as reference (read-only) + Adds the selected library as a read-only file. The library is reloaded each time you start %PRODUCTNAME. + Replace existing libraries + Replaces a library that has the same name with the current library. + + diff --git a/helpcontent2/source/text/sbasic/shared/01000000.xhp b/helpcontent2/source/text/sbasic/shared/01000000.xhp new file mode 100644 index 000000000..1e436a2b1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01000000.xhp @@ -0,0 +1,44 @@ + + + + + + + + +Programming with $[officename] Basic +/text/sbasic/shared/01000000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Programming with $[officename] Basic + This is where you find general information about working with macros and $[officename] Basic. +
+ + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/01010210.xhp b/helpcontent2/source/text/sbasic/shared/01010210.xhp new file mode 100644 index 000000000..e60bdab22 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01010210.xhp @@ -0,0 +1,58 @@ + + + + + + + + + + +Basics +/text/sbasic/shared/01010210.xhp + + + +
+fundamentals +subroutines +variables;global and local +modules;subroutines and functions +Basics +This section provides the fundamentals for working with $[officename] Basic. +
+$[officename] Basic code is based on subroutines and functions that are specified between sub...end sub and function...end function sections. Each Sub or Function can call other Subs and Functions. If you take care to write generic code for a Sub or Function, you can probably re-use it in other programs. See also Procedures and Functions. + +Some restrictions apply for the names of your public variables, subs, and functions. You must not use the same name as one of the modules of the same library. + +What is a Sub? + +Sub is the short form of subroutine, that is used to handle a certain task within a program. Subs are used to split a task into individual procedures. Splitting a program into procedures and sub-procedures enhances readability and reduces the error-proneness. A sub possibly takes some arguments as parameters but does not return any values back to the calling sub or function, for example: +DoSomethingWithTheValues(MyFirstValue,MySecondValue) +What is a Function? +A function is essentially a sub, which returns a value. You may use a function at the right side of a variable declaration, or at other places where you normally use values, for example: +MySecondValue = myFunction(MyFirstValue) +Global and local variables +Global variables are valid for all subs and functions inside a module. They are declared at the beginning of a module before the first sub or function starts. +Variables that you declare within a sub or function are valid only inside this sub or function. These variables override global variables with the same name and local variables with the same name coming from superordinate subs or functions. +Structuring +After separating your program into procedures and functions (Subs and Functions), you can save these procedures and functions as files for reuse in other projects. $[officename] Basic supports Modules and Libraries. Subs and functions are always contained in modules. You can define modules to be global or part of a document. Multiple modules can be combined to a library. +You can copy or move subs, functions, modules and libraries from one file to another by using the Macro dialog. + +
diff --git a/helpcontent2/source/text/sbasic/shared/01020000.xhp b/helpcontent2/source/text/sbasic/shared/01020000.xhp new file mode 100644 index 000000000..24b1d8165 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01020000.xhp @@ -0,0 +1,44 @@ + + + + + + + + +Syntax +/text/sbasic/shared/01020000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Syntax + This section describes the basic syntax elements of $[officename] Basic. For a detailed description please refer to the $[officename] Basic Guide which is available separately. +
+ + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/01020100.xhp b/helpcontent2/source/text/sbasic/shared/01020100.xhp new file mode 100644 index 000000000..8b777f7ba --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01020100.xhp @@ -0,0 +1,201 @@ + + + + + + + Using Variables + /text/sbasic/shared/01020100.xhp + + + + + +
+ + names of variables + variables; using + types of variables + declaring variables + values;of variables + literals;integer + literals;hexadecimal + literals;integer + literals;octal + literals;&h notation + literals;&o notation + literals;floating-point + constants + arrays;declaring + defining;constants + + + +Using Variables +The following describes the basic use of variables in $[officename] Basic. +
+ +Naming Conventions for Variable Identifiers +A variable name can consist of a maximum of 255 characters. The first character of a variable name must be a letter A-Z or a-z. Numbers can also be used in a variable name, but punctuation symbols and special characters are not permitted, with exception of the underscore character ("_"). In $[officename] Basic variable identifiers are not case-sensitive. Variable names may contain spaces but must be enclosed in square brackets if they do. +Examples for variable identifiers: + + + MyNumber=5 'Correct' + MyNumber5=15 'Correct' + MyNumber_5=20 'Correct' + My Number=20 'Not valid, variable with space must be enclosed in square brackets' + [My Number]=12 'Correct' + DéjàVu=25 'Not valid, special characters are not allowed' + 5MyNumber=12 'Not valid, variable may not begin with a number' + Number,Mine=12 'Not valid, punctuation marks are not allowed' + + +Declaring Variables +In $[officename] Basic you don't need to declare variables explicitly. A variable declaration can be performed with the Dim statement. You can declare more than one variable at a time by separating the names with a comma. To define the variable type, use either a type-declaration sign after the name, or the appropriate key word. +Examples for variable declarations: + + + Dim a$ 'Declares the variable "a" as a String' + Dim a As String 'Declares the variable "a" as a String' + Dim a$, b As Integer 'Declares one variable as a String and one as an Integer' + Dim c As Boolean 'Declares c as a Boolean variable that can be TRUE or FALSE' + + +Once you have declared a variable as a certain type, you cannot declare the variable under the same name again as a different type! + +Forcing Variable Declarations +To force declaration of variables, use the following command: + +Option Explicit + +The Option Explicit statement has to be the first line in the module, before the first SUB. Generally, only arrays need to be declared explicitly. All other variables are declared according to the type-declaration character, or - if omitted - as the default type Single. + +Variable Types +$[officename] Basic supports four variable classes: + + + + Numeric variables can contain number values. Some variables are used to store large or small numbers, and others are used for floating-point or fractional numbers. + + + String variables contain character strings. + + + Boolean variables contain either the TRUE or the FALSE value. + + + Object variables can store objects of various types, like tables and documents within a document. + + +Integer Variables +Integer variables range from -32768 to 32767. If you assign a floating-point value to an integer variable, the decimal places are rounded to the next integer. Integer variables are rapidly calculated in procedures and are suitable for counter variables in loops. An integer variable only requires two bytes of memory. "%" is the type-declaration character. + +Dim Variable% +Dim Variable As Integer + + +Long Integer Variables +Long integer variables range from -2147483648 to 2147483647. If you assign a floating-point value to a long integer variable, the decimal places are rounded to the next integer. Long integer variables are rapidly calculated in procedures and are suitable for counter variables in loops for large values. A long integer variable requires four bytes of memory. "&" is the type-declaration character. + +Dim Variable& +Dim Variable As Long + + +Decimal Variablessee i64349 +Decimal variables can take positive or negative numbers or zero. Accuracy is up to 29 digits.i85284 +You can use plus (+) or minus (-) signs as prefixes for decimal numbers (with or without spaces). +If a decimal number is assigned to an integer variable, %PRODUCTNAME Basic rounds the figure up or down.information from "Programming Guide for BASIC" about decimal variables + +Single Variables +Single variables can take positive or negative values ranging from 3.402823 x 10E38 to 1.401298 x 10E-45. Single variables are floating-point variables, in which the decimal precision decreases as the non-decimal part of the number increases. Single variables are suitable for mathematical calculations of average precision. Calculations require more time than for Integer variables, but are faster than calculations with Double variables. A Single variable requires 4 bytes of memory. The type-declaration character is "!". + +Dim Variable! +Dim Variable As Single + + +Double Variables +Double variables can take positive or negative values ranging from 1.79769313486232 x 10E308 to 4.94065645841247 x 10E-324. Double variables are floating-point variables, in which the decimal precision decreases as the non-decimal part of the number increases. Double variables are suitable for precise calculations. Calculations require more time than for Single variables. A Double variable requires 8 bytes of memory. The type-declaration character is "#". + +Dim Variable# +Dim Variable As Double + + +Currency Variables +Currency variables are internally stored as 64-bit numbers (8 Bytes) and displayed as a fixed-decimal number with 15 non-decimal and 4 decimal places. The values range from -922337203685477.5808 to +922337203685477.5807. Currency variables are used to calculate currency values with a high precision. The type-declaration character is "@". + +Dim Variable@ +Dim Variable As Currency + + +

Literals for integers

+Numbers can be encoded using octal and hexadecimal forms. + + xi = &o13 ' 8 + 3 + ci = &h65 ' 6*16 + 5 + MAX_Integer = &o77777 ' 32767 = &h7FFF + MIN_Integer = &o100000 ' -32768 = &h8000 + MAX_Long = &h7fffffff ' 2147483647 = &o17777777777 + MIN_Long = &h80000000 ' -2147483648 = &o20000000000 + + +String Variables +String variables can hold character strings with up to 65,535 characters. Each character is stored as the corresponding Unicode value. String variables are suitable for word processing within programs and for temporary storage of any non-printable character up to a maximum length of 64 Kbytes. The memory required for storing string variables depends on the number of characters in the variable. The type-declaration character is "$". + +Dim Variable$ +Dim Variable As String + + +Boolean Variables +Boolean variables store only one of two values: TRUE or FALSE. A number 0 evaluates to FALSE, every other value evaluates to TRUE. + +Dim Variable As Boolean + + +Date Variables +Date variables can only contain dates and time values stored in an internal format. Values assigned to Date variables with Dateserial, Datevalue, Timeserial or Timevalue are automatically converted to the internal format. Date-variables are converted to normal numbers by using the Day, Month, Year or the Hour, Minute, Second function. The internal format enables a comparison of date/time values by calculating the difference between two numbers. These variables can only be declared with the key word Date. + +Dim Variable As Date + + +Initial Variable Values +As soon as the variable has been declared, it is automatically set to the "Null" value. Note the following conventions: + Numeric variables are automatically assigned the value "0" as soon as they are declared. + Date variables are assigned the value 0 internally; equivalent to converting the value to "0" with the Day, Month, Year or the Hour, Minute, Second function. + String variables are assigned an empty-string ("") when they are declared. + +Arrays +$[officename] Basic knows one- or multi-dimensional arrays, defined by a specified variable type. Arrays are suitable for editing lists and tables in programs. Individual elements of an array can be addressed through a numeric index. +Arrays must be declared with the Dim statement. There are several ways to define the index range of an array: + + + Dim Text$(20) '21 elements numbered from 0 to 20' + Dim Text$(5,4) '30 elements (a matrix of 6 x 5 elements)' + Dim Text$(5 To 25) '21 elements numbered from 5 to 25' + Dim Text$(-15 To 5) '21 elements (including 0), numbered from -15 to 5' + + +The index range can include positive as well as negative numbers. i36558 + +Constants +Constants have a fixed value. They are only defined once in the program and cannot be redefined later: + +Const ConstName=Expression + + +
diff --git a/helpcontent2/source/text/sbasic/shared/01020200.xhp b/helpcontent2/source/text/sbasic/shared/01020200.xhp new file mode 100644 index 000000000..aa69b267c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01020200.xhp @@ -0,0 +1,46 @@ + + + + + + + + +Using Objects +/text/sbasic/shared/01020200.xhp + + +Sun Microsystems, Inc. + + + +
+Using the Object Catalog + +The object catalog provides an overview of all modules and dialogs you have created in $[officename]. +
+
+Click the Object Catalog icon +Icon + in the Macro toolbar to display the object catalog. +The dialog shows a list of all existing objects in a hierarchical representation. Double-clicking a list entry opens its subordinate objects. +To display a certain module in the Editor or to position the cursor in a selected SUB or FUNCTION, double click on the corresponding entry. +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/01020300.xhp b/helpcontent2/source/text/sbasic/shared/01020300.xhp new file mode 100644 index 000000000..6780cbda9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01020300.xhp @@ -0,0 +1,164 @@ + + + + + + Using Procedures, Functions or Properties + /text/sbasic/shared/01020300.xhp + + + + + procedures + functions;using + variables;passing to procedures, functions, properties + parameters;for procedures, functions or properties + parameters;passing by reference or value + variables;scope + scope of variables + GLOBAL variables + PUBLIC variables + PRIVATE variables + functions;return value type + return value type of functions + +
+

Using Procedures, Functions and Properties

+The following describes the basic use of procedures, functions and properties in %PRODUCTNAME Basic. +
+When you create a new module, %PRODUCTNAME Basic automatically inserts a Sub called "Main". This default name has nothing to do with the order or the starting point of a %PRODUCTNAME Basic project. You can also safely rename this Subroutine. +Some restrictions apply for the names of your public variables, subroutines, functions and properties. You must not use the same name as one of the modules of the same library. +Procedures (Subroutines) functions (Function) and properties (Property) help you maintaining a structured overview by separating a program into logical pieces. +One benefit of procedures, functions and properties is that, once you have developed a program code containing task components, you can use this code in another project. +

Passing Variables to Procedures, Functions or Properties

+Variables can be passed to both procedures, functions or properties. The Sub Function or Property must be declared to expect parameters: + + Sub SubName(Parameter1 As TYPENAME, Parameter2 As TYPENAME,...) + ' your code goes here + End Sub + +The Sub is called using the following syntax: + + SubName(Value1, Value2,...) + +The parameters passed to a Sub must fit to those specified in the Sub declaration. +The same process applies to a Function. In addition, functions always return a function result. The result of a function is defined by assigning the return value to the function name: + + Function FunctionName(Parameter1 As TYPENAME, Parameter2 As TYPENAME,...) As TYPENAME + ' your code goes here + FunctionName=Result + End Function + +The Function is called using the following syntax: + + Variable=FunctionName(Parameter1, Parameter2,...) + +Properties combine the syntax of procedures and functions. A property usually requires up to one parameter. + + Private _IsApproved As TYPENAME + Property Get IsApproved As TYPENAME + ' your code goes here + IsApproved = some_computation + End Property + Property Let IsApproved(value As TYPENAME) + ' your code goes here + _IsApproved = computed_value + End Property + +The Property is called using the following syntax: + + var = IsApproved + IsApproved = some_value + +You can also use the fully qualified name to call a procedure, function or property:
Library.Module.Macro()
For example, to call the Autotext macro from the Gimmicks library, use the following command:
Gimmicks.AutoText.Main()
+

Passing Variables by Value or Reference

+Parameters can be passed to a procedure, a function or a property either by reference or by value. Unless otherwise specified, a parameter is always passed by reference. That means that a Sub, a Function or a Property gets the parameter and can read and modify its value. +If you want to pass a parameter by value insert the key word ByVal in front of the parameter when you call a Sub, a Function or a Property, for example: + + Function ReadOnlyParms(ByVal p2, ByVal p2) + ' your code goes here + End Function + result = ReadOnlyParms(parm1, parm2) + +In this case, the original content of the parameter will not be modified by the Function since it only gets the value and not the parameter itself. +

Defining Optional Parameters

+Functions, procedures or properties can be defined with optional parameters, for example: + + Sub Rounding(number, Optional decimals, Optional format) + ' your code goes here + End Sub + +

Scope of Variables

+A variable defined within a Sub, a Function or a Property, only remains valid until the procedure is exited. This is known as a "local" variable. In many cases, you need a variable to be valid in all procedures, in every module of all libraries, or after a Sub, a Function or a Property is exited. +

Declaring Variables Outside a Sub a Function or a Property

+ +Global VarName As TYPENAME + +The variable is valid as long as the %PRODUCTNAME session lasts. + +Public VarName As TYPENAME + +The variable is valid in all modules. + +Private VarName As TYPENAME + +The variable is only valid in this module. + +Dim VarName As TYPENAME + +The variable is only valid in this module. +

Example for private variables

+ Enforce private variables to be private across modules by setting CompatibilityMode(True).from i17948, see i54894 + + ' ***** Module1 ***** + Private myText As String + Sub initMyText + myText = "Hello" + Print "In module1 : ", myText + End Sub + + ' ***** Module2 ***** + 'Option Explicit + Sub demoBug + CompatibilityMode( True ) + initMyText + ' Now returns empty string + ' (or raises error for Option Explicit) + Print "Now in module2 : ", myText + End Sub + +

Saving Variable Content after Exiting a Sub a Function or a Property

+ + Static VarName As TYPENAME + +The variable retains its value until the next time the a Function, Sub or Property is entered. The declaration must exist inside a Sub, a Function or a Property. +

Specifying the Return Value Type of a Function or a Property

+As with variables, include a type-declaration character after the function name, or the type indicated by As and the corresponding data type at the end of the parameter list to define the type of the function or property's return value, for example: + + Function WordCount(WordText As String) As Integer + +
+ + + Optional keyword + Property Statement + Static Statement +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/01020500.xhp b/helpcontent2/source/text/sbasic/shared/01020500.xhp new file mode 100644 index 000000000..297dfaab7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01020500.xhp @@ -0,0 +1,49 @@ + + + + + + + + +Libraries, Modules and Dialogs +/text/sbasic/shared/01020500.xhp + + +Sun Microsystems, Inc. + + + +
+Libraries, Modules and Dialogs +The following describes the basic use of libraries, modules and dialogs in $[officename] Basic. +
+$[officename] Basic provides tools to help you structuring your projects. It supports various "units" which enable you to group individual SUBS and FUNCTIONS in a Basic project. +Libraries +Libraries serve as a tool for organizing modules, and can either be attached to a document or a template. When the document or a template is saved, all modules contained in the library are automatically saved as well. +A library can contain up to 16,000 modules. +Modules +A module contains SUBS and FUNCTIONS along with variable declarations. The length of the program that can be saved in a module is limited to 64 KB. If more space is required you can divide a $[officename] Basic project among several modules, and then save them in a single library. +Dialog Modules +Dialog modules contain dialog definitions, including the dialog box properties, the properties of each dialog element and the events assigned. Since a dialog module can only contain a single dialog, they are often referred to as "dialogs". +
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/01030000.xhp b/helpcontent2/source/text/sbasic/shared/01030000.xhp new file mode 100644 index 000000000..bfc4c77c0 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01030000.xhp @@ -0,0 +1,46 @@ + + + + + + + + +Integrated Development Environment (IDE) +/text/sbasic/shared/01030000.xhp + + +Sun Microsystems, Inc. + + + +
+Basic IDE;Integrated Development Environment +IDE;Integrated Development Environment + +Integrated Development Environment (IDE) +This section describes the Integrated Development Environment for $[officename] Basic. +
+ + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/01030100.xhp b/helpcontent2/source/text/sbasic/shared/01030100.xhp new file mode 100644 index 000000000..102ba799f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01030100.xhp @@ -0,0 +1,45 @@ + + + + + + + + +IDE Overview +/text/sbasic/shared/01030100.xhp + + +Sun Microsystems, Inc. + + + + +
+IDE Overview +
+The Macro Toolbar in the IDE provides various icons for editing and testing programs. +In the Editor window, directly below the Macro toolbar, you can edit the Basic program code. The column on the left side is used to set breakpoints in the program code. +The Watch window (observer) is located below the Editor window at the left, and displays the contents of variables or arrays during a single step process. +The Call Stack window to the right provides information about the call stack of SUBS and FUNCTIONS when a program runs. +
+Basic IDE +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/01030200.xhp b/helpcontent2/source/text/sbasic/shared/01030200.xhp new file mode 100644 index 000000000..3045d3a85 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01030200.xhp @@ -0,0 +1,86 @@ + + + + + + + + + + +The Basic Editor +/text/sbasic/shared/01030200.xhp + + + +
+saving;Basic code +loading;Basic code +Basic editor +navigating;in Basic projects +long lines;in Basic editor +lines of text;in Basic editor +continuation;long lines in editor +The Basic Editor +
+The Basic Editor provides the standard editing functions you are familiar with when working in a text document. It supports the functions of the Edit menu (Cut, Delete, Paste), the ability to select text with the Shift key, as well as cursor positioning functions (for example, moving from word to word with CommandCtrl and the arrow keys). +Long lines can be split into several parts by inserting a space and an underline character _ as the last two characters of a line. This connects the line with the following line to one logical line. (If "Option Compatible" is used in the same Basic module, the line continuation feature is also valid for comment lines.) +If you press the Run BASIC icon on the Macro bar, program execution starts at the first line of the Basic editor. The program executes the first Sub or Function and then program execution stops. The "Sub Main" does not take precedence on program execution. +Insert your Basic code between the Sub Main and End Sub lines that you see when you first open the IDE. Alternatively, delete all lines and then enter your own Basic code. +Navigating in a Project +The Library List +Select a library from the Library list at the left of the toolbar to load the library in the editor. The first module of the selected library will be displayed. +The Object Catalog + +Saving and Loading Basic Source Code +You can save Basic code in a text file for saving and importing in other programming systems. +You cannot save Basic dialogs to a text file. +Saving Source Code to a Text File + + +Select the module that you want to export as text from the object catalog. + + +Click the Save Source As icon in the Macro toolbar. + + +Select a file name and click OK to save the file. + + +Loading Source Code From a Text File + + +Select the module where you want to import the source code from the object catalog. + + +Position the cursor where you want to insert the program code. + + +Click the Insert Source Text icon in the Macro toolbar. + + +Select the text file containing the source code and click OK. + + +
+Basic IDE + +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/01030300.xhp b/helpcontent2/source/text/sbasic/shared/01030300.xhp new file mode 100644 index 000000000..71eabb848 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01030300.xhp @@ -0,0 +1,63 @@ + + + + + + + + + + +Debugging a Basic Program +/text/sbasic/shared/01030300.xhp + + + +
+debugging Basic programs +variables; observing values +watching variables +run-time errors in Basic +error codes in Basic +breakpoints +Call Stack window +Debugging a Basic Program +
+Breakpoints and Single Step Execution +You can check each line in your Basic program for errors using single step execution. Errors are easily traced since you can immediately see the result of each step. A pointer in the breakpoint column of the Editor indicates the current line. You can also set a breakpoint if you want to force the program to be interrupted at a specific position. +Double-click in the breakpoint column at the left of the Editor window to toggle a breakpoint at the corresponding line. When the program reaches a breakpoint, the program execution is interrupted. +The single step execution using the Single Step icon causes the program to branch into procedures and functions. +The procedure step execution using the Procedure Step icon causes the program to skip over procedures and functions as a single step. +Properties of a Breakpoint +The properties of a breakpoint are available through its context menu by right-clicking the breakpoint in the breakpoint column. +You can activate and deactivate a breakpoint by selecting Active from its context menu. When a breakpoint is deactivated, it does not interrupt the program execution. +Select Properties from the context menu of a breakpoint or select Breakpoints from the context menu of the breakpoint column to call the Breakpoints dialog where you can specify other breakpoint options. +The list displays all breakpoints with the corresponding line number in the source code. You can activate or deactivate a selected breakpoint by checking or clearing the Active box. +The Pass Count specifies the number of times the breakpoint can be passed over before the program is interrupted. If you enter 0 (default setting) the program is always interrupted as soon as a breakpoint is encountered. +Click Delete to remove the breakpoint from the program. +Observing the Value of Variables +You can monitor the values of a variable by adding it to the Watch window. To add a variable to the list of watched variables, type the variable name in the Watch text box and press Enter. +The values of variables are only displayed if they are in scope. Variables that are not defined at the current source code location display ("Out of Scope") instead of a value. +You can also include arrays in the Watch window. If you enter the name of an array variable without an index value in the Watch text box, the content of the entire array is displayed. +If you rest the mouse over a predefined variable in the Editor at run-time, the content of the variable is displayed in a pop-up box.The Call Stack Window +Provides an overview of the call hierarchy of procedures and functions. You can determine which procedures and functions called which other procedures and functions at the current point in the source code. +List of Run-Time Errors + + +
diff --git a/helpcontent2/source/text/sbasic/shared/01030400.xhp b/helpcontent2/source/text/sbasic/shared/01030400.xhp new file mode 100644 index 000000000..73f4ccdaa --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01030400.xhp @@ -0,0 +1,211 @@ + + + + + +Organizing Libraries and Modules +/text/sbasic/shared/01030400.xhp + + + +
+ +libraries;organizing +libraries;containers +modules;organizing +copying;modules +adding libraries +deleting;libraries/modules/dialogs +dialogs;organizing +moving;modules +organizing;modules/libraries/dialogs +renaming modules and dialogs +

Organizing Libraries and Modules +

+
+

Basic Libraries Containers

+%PRODUCTNAME Basic libraries can be stored in 3 different containers: + + + %PRODUCTNAME Macros: libraries stored in this container are available for all users of the computer and are managed by the computer administrator. The container is located in the %PRODUCTNAME installation directory. + + + My Macros: libraries stored in this container are available to all documents of your user. The container is located in the user profile area and is not accessible by another user. + + + Document: libraries stored in the document container are only available for the document and are accessible only when the document is open. You cannot access macros of a document from another document. + + +To access macros stored in libraries of %PRODUCTNAME Macros or My Macros from another container, including the document container, use the GlobalScope specifier. +

Organizing Libraries

+

Creating a New Library

+ + +Choose Tools - Macros - Organize Macros - %PRODUCTNAME Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog. + + +Click the Libraries tab. + + +Select to where you want to attach the library in the Location list. If you select %PRODUCTNAME Macros & Dialogs, the library will belong to the $[officename] application and will be available for all documents. If you select a document the library will be attached to this document and only available from there. + + +Click New and insert a name to create a new library. + + +

Import a Library

+ + +Choose Tools - Macros - Organize Macros - %PRODUCTNAME Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog. + + +Click the Libraries tab. + + +Select to where you want to import the library in the Location list. If you select %PRODUCTNAME Macros & Dialogs, the library will belong to the $[officename] application and will be available for all documents. If you select a document the library will be imported to this document and only available from there. + + +Click Import... and select an external library to import. + + +Select all libraries to be imported in the Import Libraries dialog. The dialog displays all libraries that are contained in the selected file. + + +If you want to insert the library as a reference only check the Insert as reference (read-only) box. Read-only libraries are fully functional but cannot be modified in the Basic IDE. + + +Check the Replace existing libraries box if you want existing libraries of the same name to be overwritten. + + +Click OK to import the library. + + +

Export a Library

+ + +Choose Tools - Macros - Organize Macros - %PRODUCTNAME Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog. + + +Click the Libraries tab. + + +In the Location list you specify where your library is stored. Select the library that you want to export. Note that you cannot export the Standard library. + + +Click Export... + + +Choose whether you want to export the library as an extension or as a basic library. + + +Click OK. + + +Select where you want your library exported. + + +Click Save to export the library. + + +

Deleting a Library

+ + +Choose Tools - Macros - Organize Macros - %PRODUCTNAME Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog. + + +Click the Libraries tab. + + +Select the library to be deleted from the list. + + +Click Delete. + + + + +Deleting a library permanently deletes all existing modules and corresponding procedures and functions. + + +You cannot delete the default library named "Standard". + + +If you delete a library that was inserted as reference only the reference is deleted but not the library itself. + + +

Organizing Modules and Dialogs

+

Creating a New Module or Dialog

+ + +Choose Tools - Macros - Organize Macros - %PRODUCTNAME Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog. + + +Click the Modules tab or the Dialogs tab. + + +Select the library where the module will be inserted and click New. + + +Enter a name for the module or the dialog and click OK. + + +

Renaming a Module or Dialog

+ + +Choose Tools - Macros - Organize Macros - %PRODUCTNAME Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog. + + +Click the module to be renamed twice, with a pause between the clicks. Enter the new name. +In the Basic IDE, right-click the name of the module or dialog in the tabs at the bottom of the screen, choose Rename and type in the new name. + + +Press Enter to confirm your changes. + + +

Deleting a Module or Dialog

+ + +Choose Tools - Macros - Organize Macros - %PRODUCTNAME Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog. + + +Click the Modules tab or the Dialogs tab. + + +Select the module or dialog to be deleted from the list. Double-click an entry to reveal sub-entries, if required. + + +Click Delete. + + +Deleting a module permanently deletes all existing procedures and functions in that module. +

Organizing Projects among Documents or Templates

+

Moving or copying modules between documents, templates and the application.

+ + +Open all documents or templates among which you want to move or copy the modules or dialogs. + + +Choose Tools - Macros - Organize Macros - %PRODUCTNAME Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog. + + +To move a module or dialog to another document, click the corresponding object in the list and drag it to the desired position. A horizontal line indicates the target position of the current object while dragging. Hold the CommandCtrl key while dragging to copy the object instead of moving it. + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/01040000.xhp b/helpcontent2/source/text/sbasic/shared/01040000.xhp new file mode 100644 index 000000000..8d9e2bb8b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01040000.xhp @@ -0,0 +1,227 @@ + + + + + + + + + Event-Driven Macros + /text/sbasic/shared/01040000.xhp + + + +
+deleting; macro assignments to events + macros; assigning to events + assigning macros to events + events; assigning macros + +Event-Driven Macros + This section describes how to assign Basic programs to program events. +
+ You can automatically execute a macro when a specified software event occurs by assigning the desired macro to the event. The following table provides an overview of program events and at what point an assigned macro is executed. + + + + Event + + + An assigned macro is executed... + + + + + Program Start + + + ... after a $[officename] application is started. + + + + + Program End + + + ...before a $[officename] application is terminated. + + + + + Create Document + + + ...after a new document is created with File - New or with the New icon. + + + + + Open Document + + + ...after a document is opened with File - Open or with the Open icon. + + + + + Save Document As + + + ...before a document is saved under a specified name (with File - Save As, or with File - Save or the Save icon, if a document name has not yet been specified). + + + + + Document has been saved as + + + ... after a document was saved under a specified name (with File - Save As, or with File - Save or with the Save icon, if a document name has not yet been specified). + + + + + Save Document + + + ...before a document is saved with File - Save or the Save icon, provided that a document name has already been specified. + + + + + Document has been saved + + + ...after a document is saved with File - Save or the Save icon, provided that a document name has already been specified. + + + + + Document is closingi104852 + + + ...before a document is closed. + + + + + Document closed + + + ...after a document was closed. Note that the "Save Document" event may also occur when the document is saved before closing. + + + + + Activate Document + + + ...after a document is brought to the foreground. + + + + + Deactivate Document + + + ...after another document is brought to the foreground. + + + + + Print Document + + + ...after the Print dialog is closed, but before the actual print process begins. + + + + + JavaScript run-time error + + + ...when a JavaScript run-time error occurs. + + + + + Print Mail Merge + + + ...after the Print dialog is closed, but before the actual print process begins. This event occurs for each copy printed. + + + + + Change of the page count + + + ...when the page count changes. + + + + + Message received + + + ...if a message was received. + + +
+ + Assigning a Macro to an Event + + + Choose Tools - Customize and click the Events tab. + + + Select whether you want the assignment to be globally valid or just valid in the current document in the Save In listbox. + + + Select the event from the Event list. + + + Click Macro and select the macro to be assigned to the selected event. + + + Click OK to assign the macro. + + + Click OK to close the dialog. + + + Removing the Assignment of a Macro to an Event + + + Choose Tools - Customize and click the Events tab. + + + Select whether you want to remove a global assignment or an assignment that is just valid in the current document by selecting the option in the Save In listbox. + + + Select the event that contains the assignment to be removed from the Event list. + + + Click Remove. + + + Click OK to close the dialog. + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/01050000.xhp b/helpcontent2/source/text/sbasic/shared/01050000.xhp new file mode 100644 index 000000000..459be373a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01050000.xhp @@ -0,0 +1,65 @@ + + + + + + + + +$[officename] Basic IDE +/text/sbasic/shared/01050000.xhp + + +Sun Microsystems, Inc. + + + +
+$[officename] Basic IDE + +This section describes the structure of the Basic IDE. + +Opens the Basic IDE where you can write and edit macros. +
+ + + + + +Commands From the Context menu of the Module Tabs +Insert + +Module +Inserts a new module into the current library. + +Dialog +Inserts a new dialog into the current library. + +Delete +Deletes the selected module. + +Rename +Renames the current module in place. + +Hide +Hides the current module. +Modules +Opens the Macro Organizer dialog. + +
diff --git a/helpcontent2/source/text/sbasic/shared/01050100.xhp b/helpcontent2/source/text/sbasic/shared/01050100.xhp new file mode 100644 index 000000000..acbd67cb9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01050100.xhp @@ -0,0 +1,60 @@ + + + + + + + + +Watch Window +/text/sbasic/shared/01050100.xhp + + +Sun Microsystems, Inc. + + + +
+Watch Window +The Watch window allows you to observe the value of variables during the execution of a program. Define the variable in the Watch text box. Click on Enable Watch to add the variable to the list box and to display its values. +
+ +Watch +Enter the name of the variable whose value is to be monitored. + +Remove Watch +Removes the selected variable from the list of watched variables. + + + + +Icon + + + +Remove Watch + + +
+ + +Editing the Value of a Watched Variable +Displays the list of watched variables. Click twice with a short pause in between on an entry to edit its value. The new value will be taken as the variable's value for the program. + +
diff --git a/helpcontent2/source/text/sbasic/shared/01050200.xhp b/helpcontent2/source/text/sbasic/shared/01050200.xhp new file mode 100644 index 000000000..be2374454 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01050200.xhp @@ -0,0 +1,39 @@ + + + + + + + + +Call Stack Window (Calls) +/text/sbasic/shared/01050200.xhp + + +Sun Microsystems, Inc. + + + +
+ +Call Stack Window (Calls) +Displays the sequence of procedures and functions during the execution of a program. The Call Stack allows you to monitor the sequence of procedures and functions during the execution of a program. The procedures are functions are displayed bottom to top with the most recent function or procedure call at the top of the list. +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/01050300.xhp b/helpcontent2/source/text/sbasic/shared/01050300.xhp new file mode 100644 index 000000000..cad3ad6ff --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01050300.xhp @@ -0,0 +1,58 @@ + + + + + + + + +Manage Breakpoints +/text/sbasic/shared/01050300.xhp + + +Sun Microsystems, Inc. + + + +
+ + + + +Manage Breakpoints +Specifies the options for breakpoints. +
+ +Breakpoints +Enter the line number for a new breakpoint, then click New. + + +Active +Activates or deactivates the current breakpoint. + +Pass Count +Specify the number of loops to perform before the breakpoint takes effect. + +New +Creates a breakpoint on the line number specified. + +Delete +Deletes the selected breakpoint. + +
diff --git a/helpcontent2/source/text/sbasic/shared/01170100.xhp b/helpcontent2/source/text/sbasic/shared/01170100.xhp new file mode 100644 index 000000000..05153753d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01170100.xhp @@ -0,0 +1,104 @@ + + + + + + + + +Control and Dialog Properties +/text/sbasic/shared/01170100.xhp + + +Sun Microsystems, Inc. + + + +
+controls; properties +properties; controls and dialogs +dialogs; properties + +Control and Dialog Properties +
+Specifies the properties of the selected dialog or control. You must be in the design mode to be able to use this command. +Entering Data in the Properties Dialog +The following key combinations apply to enter data in multiline fields or combo boxes of the Properties dialog: + + + +Keys + + +Effects + + + + +Alt+Down Arrow + + +Opens a combo box + + + + +Alt+Up Arrow + + +Closes a combo box + + + + +Shift+Enter + + +Inserts a line break in multiline fields. + + + + +(UpArrow) + + +Goes to the previous line. + + + + +(DownArrow) + + +Goes to the next line. + + + + +Enter + + +Applies the changes made to a field and places the cursor into the next field. + + +
+ + + +
diff --git a/helpcontent2/source/text/sbasic/shared/01170101.xhp b/helpcontent2/source/text/sbasic/shared/01170101.xhp new file mode 100644 index 000000000..80fb865c5 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01170101.xhp @@ -0,0 +1,444 @@ + + + + + + + + + + +General +/text/sbasic/shared/01170101.xhp + + + +
+General +Define the properties for the selected control or dialog. The available properties depend on the type of control selected. The following properties therefore are not available for every type of control. +
+
+Alignment +Specify the alignment option for the selected control. +
+
+AutoFill +Select "Yes" to enable the AutoFill function for the selected control. +
+
Background color +Specify the background color for the current control. +
+
+Large change +Specify the number of units to scroll when a user clicks in the area between the slider and the arrows on a scrollbar. +
+
Border +Specify the border type for the current control. +
+
+Button type +Select a button type. Button types determine what type of action is initiated. +
+
Character set +Select the font to be used for displaying the contents of the current control. +
+
+Currency symbol +Enter the currency symbol to be used for currency controls. +
+
+Date +Specify the default date to be shown in the Date control. +
+
+Date format +Specify the desired format for a date control. A date control interprets the user input depending on this format setting. +
+
+Date max. +Specify the upper limit for a date control. +
+
+Date min. +Specify the lower limit for a date control. +
+
+Decimal accuracy +Specify the number of decimal places displayed for a numerical or currency control. +
+
+Default button +Select "Yes" to make the current button control the default selection. Pressing Return in the dialog activates the default button. +
+
+Delay +Specifies the delay in milliseconds between scrollbar trigger events. A trigger event occurs when you click a scrollbar arrow or click the background area in a scrollbar. Repeated trigger events occur if you keep the mouse button pressed when you click a scrollbar arrow or background area in a scrollbar. If you want, you can include valid time units with the number that you enter, for example, 2 s or 500 ms. +
+
Dropdown +Select "Yes" to enable the dropdown option for list or combo box controls. A dropdown control field has an arrow button which you can click to open a list of the existing form entries. +
+
+Enabled +Select "Yes" to enable the control. If the control is disabled, it is grayed out in the dialog. +
+
+Edit mask +Specify the edit mask for a pattern control. This is a character code that defines the input format for the control. +You need to specify a masking character for each input character of the edit mask to restrict the input to the values that are listed in the following table: + + + + Character + + +Meaning + + + + +L + + +A text constant. This character cannot be modified by the user. + + + + +a + + +The characters a-z can be entered here. If a capital letter is entered, it is automatically converted to a lowercase letter. + + + + +A + + +The characters A-Z can be entered here. If a lowercase letter is entered, it is automatically converted to a capital letter + + + + +c + + +The characters a-z and 0-9 can be entered here. If a capital letter is entered, it is automatically converted to a lowercase letter. + + + + +C + + +The characters a-z and 0-9 can be entered here. If a lowercase letter is entered, it is automatically converted to a capital letter + + + + +N + + +Only the characters 0-9 can be entered. + + + + +x + + +All printable characters can be entered. + + + + +X + + +All printable characters can be entered. If a lowercase letter is used, it is automatically converted to a capital letter. + + +
+
+
+Editable +Specifies whether the nodes of the tree control are editable. +The default value is FALSE. +
+
Graphics +Specify the source of the graphics for a button or an image control. Click "..." to select a file. +
+
+Height +Specify the height of the current control or the dialog. +
+
+Help text +Enter a help text that is displayed as a tip (bubble help) when the mouse rests over the control. +
+
+Help URL +Specify the help URL that is called when you press F1 while the focus is on a particular control. For example, use the format HID:1234 to call the Help-ID with the number 1234. +Set the environment variable HELP_DEBUG to 1 to view the Help-IDs as extended help tips. +
+
+Incr./decrement value +Specify the increment and decrement interval for spin button controls. +
+
+Invokes stop mode editing +Specifies what happens when editing is interrupted by selecting another node in the tree, a change in the tree's data, or by some other means. +Setting this property to TRUE causes the changes to be automatically saved when editing is interrupted. FALSE means that editing is canceled and changes are lost. +The default value is FALSE. +
+
Label +Specifies the label of the current control. The label is displayed along with the control. +You can create multi-line labels by inserting manual line breaks in the label using Shift+Enter. +
+
+Line Count +Enter the number of lines to be displayed for a list control. For combo boxes, this setting is only active if the dropdown option is enabled. +
+
+Scrollbar +Adds the scrollbar type that you specify to a text box. +
+
+Small change +Specify the number of units to scroll when a user clicks an arrow on a scrollbar. +
+
List entries +Specify the entries for a list control. One line takes one list entry. Press Shift+Enter to insert a new line. +
+
+Literal mask +Specify the initial values to be displayed in a pattern control. This helps the user to identify which values are allowed in a pattern control. The literal mask is restricted by the format specified by the edit mask. +
+
+Manual line break +Select "Yes" to allow manual line breaks inside multiline controls. +
+
+Max. text length +Specify the maximum number of characters that the user can enter. +
+
Multiline Input +Select "Yes" to allow the input of multiple lines in the control. Press Enter to insert a manual line break in the control. +
+
+Multiselection +Select "Yes" to allow the selection of multiple entries in list controls. +
+
Name +Insert a name for the current control. This name is used to identify the control. +
+
Order +Specify the order in which the controls receive the focus when the Tab key is pressed in the dialog. On entering a dialog, the control with the lowest order (0) receives the focus. Pressing the Tab key the successively focuses the other controls as specified by their order number. +Initially, the controls receive numbers in the order they are added to the dialog. You can change the order numbers for controls. $[officename] Basic updates the order numbers automatically to avoid duplicate numbers. Controls that cannot be focused are also assigned a value but these controls are skipped when using the Tab key. +
+
+Orientation +Specify the orientation for a scrollbar control. +
+
+Page (step) +Specify the number of the dialog page to which the current control is assigned or the page number of the dialog you want to edit. If a dialog has only one page set its Page (Step) value to 0. +Select Page (Step) = 0 to make a control visible on every dialog page. +To switch between dialog pages at run time, you need to create a macro that changes the value of Page (Step). +
+
+Password characters +Enter a character to be displayed instead of the characters that are typed. This can be used for entering passwords in text controls. +
+
+PositionXSpecify the distance of the current control from the left side of the dialog. +
+
+PositionY +Specify the distance of the current control from the top of the dialog. +
+
+Prefix symbol +Select "Yes" to display the currency symbol prefix in currency controls when a number was entered. +
+
+Print +Select "Yes" to include the current control in a document's printout. +
+
+Progress value +Specify a progress value for a progress bar control. +
+
+Progress value max. +Specify the maximum value of a progress bar control. +
+
+Progress value min. +Specify the minimum value of a progress bar control. +
+
Read-only +Select "Yes" to prevent the user from editing the value of the current control. The control is enabled and can be focused but not modified. +
+
+RepeatUFI: see spec spinbutton_form_control.sxw +Repeats trigger events when you keep the mouse button pressed on a control such as a spin button. +
+
+Root displayedsee http://specs.openoffice.org/appwide/dialog_ide/New_Tree_Control_in_IDE.odt +Specifies if the root node of the tree control is displayed. +If Root displayed is set to FALSE, the root node of a model is no longer a valid node for the tree control and can't be used with any method of XTreeControl. +The default value is TRUE. +
+
+Row height +Specifies the height of each row of a tree control, in pixels. +If the specified value is less than or equal to zero, the row height is the maximum height of all rows. +The default value is 0. +
+
+Scale +Scales the image to fit the control size. +
+
+ + +Scrollbar +Adds the scrollbar type that you specify to a text box. +
+
+Scroll value +Specify the initial value of a scrollbar control. This determines the position of the scrollbar slider. +
+
+Scroll value max. +Specify the maximum value of a scrollbar control. +
+
+Scroll value min. +Specify the minimum value of a scrollbar control. +
+
+Show handles +Specifies whether the handles of the nodes should be displayed. +The handles are dotted lines that visualize the hierarchy of the tree control. +The default value is TRUE. +
+
+Show root handles +Specifies whether the handles of the nodes should also be displayed at root level. +The default value is TRUE. +
+
+SelectionUFI: udk.features "New property and help ID for property browser in Basic IDE" +Specifies the sequence of the selected items, where "0" corresponds to the first item. To select more than one item, Multiselection must be enabled. +Click the ... button to open the Selection dialog. +Click the item or items that you want to select. To select more than one item, ensure that the Multiselection option is selected. +
+
+Selection typesee http://specs.openoffice.org/appwide/dialog_ide/New_Tree_Control_in_IDE.odt +Specifies the selection mode that is enabled for this tree control. +
+
Spin Button +Select "Yes" to add spin buttons to a numerical, currency, date, or time control to allow increasing and decreasing the input value using arrow buttons. +
+
+State +Select the selection state of the current control. +
+
+Strict format +Select "Yes" to only allow valid characters to be entered in a numerical, currency, date, or time control. +
+
Tabstop +Select the focus behavior of the current control when using the Tab key. + + + +Default + + +Only input controls receive the focus when using the Tab key. Controls without input like caption controls are omitted. + + + + +No + + +When using the tab key focusing skips the control. + + + + +Yes + + +The control can be selected with the Tab key. + + +
+
+
+Thousands Separator +Select "Yes" to display thousands separator characters in numerical and currency controls. +
+
+Time Format +Select the format to be used for time controls. +
+
+Time max. +Specify the maximum time value for a time control. +
+
+Time min. +Specify the minimum time value for a time control. +
+
+Title +Specify the title of the dialog. Click the border of the dialog to select the dialog. + +Titles are only used for labeling a dialog and can only contain one line. Please note that if you work with macros, controls are only called through their Name property. +
+
+Tristate +Select "Yes" to allow a check box to have three states (checked, unchecked, and grayed out) instead of two (checked and unchecked). +
+
+Value +Specify the value for the current control. +
+
+Value max. +Specify the maximum value for the current control. +
+
+Value min. +Specify the minimum value for the current control. +
+
+Visible size +Specify the length of the slider of a scrollbar control. +
+
Width +Specify the width of the current control or dialog. +
+
+
diff --git a/helpcontent2/source/text/sbasic/shared/01170103.xhp b/helpcontent2/source/text/sbasic/shared/01170103.xhp new file mode 100644 index 000000000..f08026f8b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/01170103.xhp @@ -0,0 +1,66 @@ + + + + + + + + +Events +/text/sbasic/shared/01170103.xhp + + +Sun Microsystems, Inc. + + + +
+Events +Define event assignments for the selected control or dialog. The available events depend on the type of control selected. +
+When receiving focus +This event takes place if a control receives the focus. +When losing focus +This event takes place if a control loses the focus. +Key pressed +This event occurs when the user presses any key while the control has the focus. +Key released +This event occurs when the user releases a key while the control has the focus. +Modified +This event takes place, when the control loses the focus and the contents of the control were changed since it lost the focus. +Text modified +This event takes place if you enter or modify a text in an input field. +Item status changed +This event takes place if the status of the control field is changed, for example, from checked to unchecked. +Mouse inside +This event takes place when the mouse enters the control. +Mouse moved while key pressed +This event takes place when the mouse is dragged while a key is pressed. +Mouse moved +This event takes place when the mouse moves over the control. +Mouse button pressed +This event takes place when the mouse button is pressed while the mouse pointer is on the control. +Mouse button released +This event takes place when the mouse button is released while the mouse pointer is on the control. +Mouse outside +This event takes place when the mouse leaves the control. +While adjusting +This event takes place when a scrollbar is being dragged. + +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11010000.xhp b/helpcontent2/source/text/sbasic/shared/02/11010000.xhp new file mode 100644 index 000000000..ad5f0a5c1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11010000.xhp @@ -0,0 +1,58 @@ + + + + + + + + +Library +/text/sbasic/shared/02/11010000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ +Library + Select the library that you want to edit. The first module of the library that you select is displayed in the Basic IDE. +
+
+ + + + + + + List box Library + + + Library List Box + + + +
+
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11020000.xhp b/helpcontent2/source/text/sbasic/shared/02/11020000.xhp new file mode 100644 index 000000000..eb78c2348 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11020000.xhp @@ -0,0 +1,55 @@ + + + + + +Compile +/text/sbasic/shared/02/11020000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ +

Compile

+ Compiles the Basic macro. You need to compile a macro after you make changes to it, or if the macro uses single or procedure steps. +
+
+ + + + + + + Icon Compile + + + Compile + + + +
+
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11030000.xhp b/helpcontent2/source/text/sbasic/shared/02/11030000.xhp new file mode 100644 index 000000000..6bafb5cde --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11030000.xhp @@ -0,0 +1,54 @@ + + + + + + + + +Run +/text/sbasic/shared/02/11030000.xhp + + +Sun Microsystems, Inc. + + + +
+ +Run +Runs the first macro of the current module. +
+
+ + + + +Icon + + + +Run + + +
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11040000.xhp b/helpcontent2/source/text/sbasic/shared/02/11040000.xhp new file mode 100644 index 000000000..52c2522d6 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11040000.xhp @@ -0,0 +1,57 @@ + + + + + + + + + + +Stop +/text/sbasic/shared/02/11040000.xhp + + + +
+macros; stopping +program stops +stopping macros + + +Stop +Stops running the current macro. + You can also press Shift+Ctrl+Q. +
+
+ + + + +Icon + + + +Stop + + +
+
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11050000.xhp b/helpcontent2/source/text/sbasic/shared/02/11050000.xhp new file mode 100644 index 000000000..80d38ae25 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11050000.xhp @@ -0,0 +1,58 @@ + + + + + + + + +Single Step +/text/sbasic/shared/02/11050000.xhp + + +Sun Microsystems, Inc. + + + +
+ +Single Step +Runs the macro and stops it after the next command. +
+You can use this command in conjunction with the Watch command to troubleshoot errors. +
+ + + + +Icon + + + +Single Step + + +
+ +
+
+Procedure Step function +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11060000.xhp b/helpcontent2/source/text/sbasic/shared/02/11060000.xhp new file mode 100644 index 000000000..6543c8e9b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11060000.xhp @@ -0,0 +1,58 @@ + + + + + + + + +Procedure Step +/text/sbasic/shared/02/11060000.xhp + + +Sun Microsystems, Inc. + + + +
+ +Procedure Step +Runs the macro and stops it after the next procedure. +
+You can use this command in conjunction with the Watch command to troubleshoot errors. +
+ + + + +Icon + + + +Procedure Step + + +
+ +
+
+Single Step function +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11070000.xhp b/helpcontent2/source/text/sbasic/shared/02/11070000.xhp new file mode 100644 index 000000000..ffee38d3b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11070000.xhp @@ -0,0 +1,53 @@ + + + + + + + + + + +Breakpoint +/text/sbasic/shared/02/11070000.xhp + + + +
+ +Breakpoint +Inserts a breakpoint in the program line. +
+The breakpoint is inserted at the cursor position. Use a breakpoint to interrupt a program just before an error occurs. You can then troubleshoot the program by running it in Single Step mode until the error occurs. You can also use the Watch icon to check the content of the relevant variables. +
+ + + + +Icon + + + +Breakpoint + + +
+
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11080000.xhp b/helpcontent2/source/text/sbasic/shared/02/11080000.xhp new file mode 100644 index 000000000..dcb2355b6 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11080000.xhp @@ -0,0 +1,56 @@ + + + + + + + + +Enable Watch +/text/sbasic/shared/02/11080000.xhp + + +Sun Microsystems, Inc. + + + +
+ +Enable Watch +Click this icon to view the variables in a macro. The contents of the variable are displayed in a separate window. +
+Click the name of a variable to select it, then click the Enable Watch icon. The value that is assigned to the variable is displayed next to its name. This value is constantly updated. +
+ + + + +Icon + + + +Enable Watch + + +
+ +
+To remove the variable watch, select the variable in the Watch window, and then click on the Remove Watch icon. + +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11090000.xhp b/helpcontent2/source/text/sbasic/shared/02/11090000.xhp new file mode 100644 index 000000000..3fdc5cc77 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11090000.xhp @@ -0,0 +1,61 @@ + + + + + + + + + + +Object Catalog +/text/sbasic/shared/02/11090000.xhp + + +Sun Microsystems, Inc. + + + +
+ +Object Catalog +Opens the Objects pane, where you can view Basic objects. +
+Double click the name of a function or sub to load the module that contains that function or sub, and to position the cursor. Double click the name of a module or dialog to load and display that module or dialog. +
+ + + + +Icon + + + +Object Catalog + + +
+ +
+ + +Window Area +Displays a hierarchical view of the current $[officename] macro libraries, modules, and dialogs. To display the contents of an item in the window, double click its name. + +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11100000.xhp b/helpcontent2/source/text/sbasic/shared/02/11100000.xhp new file mode 100644 index 000000000..6fca55681 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11100000.xhp @@ -0,0 +1,55 @@ + + + + + +Macros +/text/sbasic/shared/02/11100000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ +

Macros

+ Opens the Macro dialog. +
+
+ + + + + + + Icon Macros + + + Macros + + + +
+
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11110000.xhp b/helpcontent2/source/text/sbasic/shared/02/11110000.xhp new file mode 100644 index 000000000..9a982589e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11110000.xhp @@ -0,0 +1,55 @@ + + + + + +Modules +/text/sbasic/shared/02/11110000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ +

Modules

+ Click here to open the Macro Organizer dialog. +
+
+ + + + + + + Icon Modules + + + Modules + + + +
+
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11120000.xhp b/helpcontent2/source/text/sbasic/shared/02/11120000.xhp new file mode 100644 index 000000000..2b9009a4b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11120000.xhp @@ -0,0 +1,55 @@ + + + + + +Find Parentheses +/text/sbasic/shared/02/11120000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ +

Find Parentheses

+ Highlights the text that is enclosed by two corresponding brackets. Place the text cursor in front of an opening or closing bracket, and then click this icon. +
+
+ + + + + + + Icon Find Parentheses + + + Find Parentheses + + + +
+
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11140000.xhp b/helpcontent2/source/text/sbasic/shared/02/11140000.xhp new file mode 100644 index 000000000..156aae60d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11140000.xhp @@ -0,0 +1,55 @@ + + + + + + + + +Insert Source Text +/text/sbasic/shared/02/11140000.xhp + + +Sun Microsystems, Inc. + + + +
+ +Insert Source Text +Opens the Basic source text in the Basic IDE window. +
+Place the cursor in the code where you want to insert the source text, and then click the Insert source text icon. Locate the file that contains the Basic source text that you want to insert, and then click Open. +
+ + + + +Icon + + + +Insert source text + + +
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11150000.xhp b/helpcontent2/source/text/sbasic/shared/02/11150000.xhp new file mode 100644 index 000000000..b10f1bc79 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11150000.xhp @@ -0,0 +1,54 @@ + + + + + + + + +Save Source As +/text/sbasic/shared/02/11150000.xhp + + +Sun Microsystems, Inc. + + + +
+ +Save Source As +Saves the source code of the selected Basic macro. +
+
+ + + + +Icon + + + +Save Source As + + +
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11160000.xhp b/helpcontent2/source/text/sbasic/shared/02/11160000.xhp new file mode 100644 index 000000000..3ec6a2168 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11160000.xhp @@ -0,0 +1,55 @@ + + + + + +Step Out +/text/sbasic/shared/02/11160000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ +

Step Out

+ Jumps back to the previous routine in the current macro. +
+
+ + + + + + + Icon Step Out + + + Step Out + + + +
+
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/02/11170000.xhp b/helpcontent2/source/text/sbasic/shared/02/11170000.xhp new file mode 100644 index 000000000..f944e2aba --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11170000.xhp @@ -0,0 +1,54 @@ + + + + + + + + + Manage Breakpoints + /text/sbasic/shared/02/11170000.xhp + + + +
+ +Manage Breakpoints + Calls a dialog to manage breakpoints. +
+
+ + + + +Icon + + + + Manage Breakpoints + + +
+ +
+
+ Manage Breakpoints dialog +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/02/11180000.xhp b/helpcontent2/source/text/sbasic/shared/02/11180000.xhp new file mode 100644 index 000000000..594c3cc16 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11180000.xhp @@ -0,0 +1,63 @@ + + + + + + + + + Import Dialog + /text/sbasic/shared/02/11180000.xhp + + + +
+ +Import Dialog + Calls an "Open" dialog to import a BASIC dialog file. + If the imported dialog has a name that already exists in the library, you see a message box where you can decide to rename the imported dialog. In this case the dialog will be renamed to the next free "automatic" name like when creating a new dialog. Or you can replace the existing dialog by the imported dialog. If you click Cancel the dialog is not imported. + Dialogs can contain localization data. When importing a dialog, a mismatch of the dialogs' localization status can occur. + If the library contains additional languages compared to the imported dialog, or if the imported dialog is not localized at all, then the additional languages will silently be added to the imported dialog using the strings of the dialog's default locale. + If the imported dialog contains additional languages compared to the library, or if the library is not localized at all, then you see a message box with Add, Omit, and Cancel buttons. + + + Add: The additional languages from the imported dialog will be added to the already existing dialog. The resources from the library's default language will be used for the new languages. This is the same as if you add these languages manually. + + + Omit: The library's language settings will stay unchanged. The imported dialog's resources for the omitted languages are not copied into the library, but they remain in the imported dialog's source files. + + +
+
+ + + + +Icon + + + + Import Dialog + + +
+ +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/02/11190000.xhp b/helpcontent2/source/text/sbasic/shared/02/11190000.xhp new file mode 100644 index 000000000..dc39139a6 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/11190000.xhp @@ -0,0 +1,51 @@ + + + + + + + + + Export Dialog + /text/sbasic/shared/02/11190000.xhp + + + +
+ +Export Dialog + In the dialog editor, this command calls a "Save as" dialog to export the current BASIC dialog. +
+
+ + + + +Icon + + + + Export Dialog + + +
+ +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/02/20000000.xhp b/helpcontent2/source/text/sbasic/shared/02/20000000.xhp new file mode 100644 index 000000000..0f6286edc --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/02/20000000.xhp @@ -0,0 +1,506 @@ + + + + + + + + + + +Insert Controls +/text/sbasic/shared/02/20000000.xhp + + + +
+controls; in dialog editor +push button control in dialog editor +icon control +buttons; controls +image control +check box control +radio button control +option button control +fixed text control +label field control +editing; controls +text boxes; controls +list boxes; controls +combo box control +scroll bar control +horizontal scrollbar control +vertical scrollbar control +group box control +progress bar control +fixed line control +horizontal line control +line control +vertical line control +date field control +time field control +numerical field control +currency field control +formatted field control +pattern field control +masked field control +file selection control +selection options for controls +test mode control + + +Insert Controls +Opens the Toolbox bar.
+
+ + + + +Icon + + + +Insert Controls + + +
+
+ + +In edit mode, double-click a control to open the properties dialog. + + +In edit mode, you can also right-click a control and choose the cut, copy, and paste command. + + + +
+Button + + + + +Icon + + + +Adds a command button. You can use a command button to execute a command for a defined event, such as a mouse click. +If you want, you can add text or a graphic to the button. + + +
+
+ +
+Image Control + + + + +Icon + + + +Adds a control that displays a graphic. + + +
+
+
+Check Box + + + + +Icon + + + +Adds a check box that you can use to turn a function on or off. + + +
+
+
+Option Button + + + + +Icon + + + +Adds a button that allows a user to select from a number of options. Grouped option buttons must have consecutive tab indices. They are commonly encircled by a group box. If you have two groups of option buttons, you must insert a tab index between the tab indices of the two groups on the group frame. + + +
+
+
+Label Field + + + + +Icon + + + +Adds a field for displaying text labels. These labels are only for displaying predefined text, and not for entering text. + + +
+
+
+Text Box + + + + +Icon + + + +Adds an input box where you can enter and edit text. + + +
+
+
+List Box + + + + +Icon + + + +Adds a box where you can click an entry on a list. + + +
+
+
+Combo Box + + + + +Icon + + + +Adds a combo box. A combo box is a one line list box that a user can click, and then choose an entry from the list. If you want, you can make the entries in the combo box "read only". + + +
+
+
+Horizontal Scrollbar + + + + +Icon + + + +Adds a horizontal scrollbar to the dialog. + + +
+
+
+Vertical Scrollbar + + + + +Icon + + + +Adds a vertical scrollbar to the dialog. + + +
+
+
+Group Box + + + + +Icon + + + +Adds a frame that you can use to visually group similar controls, such as option buttons. + + +
+
+To define two different groups of option buttons, ensure that the tab index of the group frame is between the tab indices of the two groups. + +
+Progress Bar + + + + +Icon + + + +Adds a progress bar to the dialog. + + +
+
+
+Horizontal Line + + + + +Icon + + + +Adds a horizontal line to the dialog. + + +
+
+
+Vertical Line + + + + +Icon + + + +Adds a vertical line to the dialog. + + +
+
+
+Date Field + + + + +Icon + + + +Adds a date field. + + +
+If you assign the "dropdown" property to the date field, a user can drop down a calendar to select a date. +
+
+ +Time Field + + + + +Icon + + + +Adds a time field. + + +
+
+
+Numeric Field + + + + +Icon + + + +Adds a numeric field. + + +
+
+
+Currency Field + + + + +Icon + + + +Adds a currency field. + + +
+
+
+Formatted Field + + + + +Icon + + + +Adds a text box where you can define the formatting for text that is inputted or outputted as well as any limiting values. + + +
+
+
+Pattern Field + + + + +Icon + + + +Adds a masked field. A masked field consists of an input mask and a literal mask. The input mask determines which user data can be entered. The literal mask determines the state of the masked field when the form is loaded. + + +
+
+
+File Selection + + + + +Icon + + + +Adds a button that opens a file selection dialog. + + +
+
+Select + + + + +Icon + + + +Activates or deactivates the Selection mode. In this mode, you can select the controls in a dialog so that you can edit them. + + +
+Properties + + + + +Icon + + + +Opens a dialog where you can edit the properties of the selected control. + + +
+Activate Test Mode + + + + +Icon + + + +Starts test mode. Click the dialog closer icon to end test mode. + + +
+Manage Language + + + + +Manage Language icon + + + +Opens a dialog to enable or manage multiple sets of dialog resources for multiple languages. + + +
+Tree Control + + + + +Manage Language icon + + + +Adds a tree control that can show a hierarchical list. You can populate the list by your program, using API calls (XtreeControl). + + +
+ +

Table Control

+ + + + +Table control icon + + +Adds a table control that can show a table data. You can populate the data by your program, using API calls. + + +
+ +

Hyperlink Control

+ + + + +Insert hyperlink control icon + + +Adds a hyperlink control that can open an address in web browser. + + +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03/lib_depot.xhp b/helpcontent2/source/text/sbasic/shared/03/lib_depot.xhp new file mode 100644 index 000000000..2c4a01ba1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03/lib_depot.xhp @@ -0,0 +1,28 @@ + + + + + + + DEPOT Library + /text/sbasic/shared/03/lib_depot.xhp + + + + The Depot Library + +
+ +
+
+ GlobalScope.BasicLibraries.LoadLibrary("Depot")
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03/lib_euro.xhp b/helpcontent2/source/text/sbasic/shared/03/lib_euro.xhp new file mode 100644 index 000000000..5141854ee --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03/lib_euro.xhp @@ -0,0 +1,30 @@ + + + + + + + EURO Library + /text/sbasic/shared/03/lib_euro.xhp + + + + The Euro Library + + BASIC Euro library + +
+ +
+
+ GlobalScope.BasicLibraries.LoadLibrary("Euro")
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03/lib_formwizard.xhp b/helpcontent2/source/text/sbasic/shared/03/lib_formwizard.xhp new file mode 100644 index 000000000..c3ff82a11 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03/lib_formwizard.xhp @@ -0,0 +1,28 @@ + + + + + + + FORMWIZARD Library + /text/sbasic/shared/03/lib_formwizard.xhp + + + + The FormWizard Library + +
+ +
+
+ GlobalScope.BasicLibraries.LoadLibrary("FormWizard")
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03/lib_gimmicks.xhp b/helpcontent2/source/text/sbasic/shared/03/lib_gimmicks.xhp new file mode 100644 index 000000000..9a9a2e9e4 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03/lib_gimmicks.xhp @@ -0,0 +1,30 @@ + + + + + + + GIMMICKS Library + /text/sbasic/shared/03/lib_gimmicks.xhp + + + + The Gimmicks Library + + BASIC Gimmicks library + +
+ +
+
+ GlobalScope.BasicLibraries.LoadLibrary("Gimmicks")
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03/lib_schedule.xhp b/helpcontent2/source/text/sbasic/shared/03/lib_schedule.xhp new file mode 100644 index 000000000..00cf3dcc8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03/lib_schedule.xhp @@ -0,0 +1,30 @@ + + + + + + + SCHEDULE Library + /text/sbasic/shared/03/lib_schedule.xhp + + + + The Schedule Library + + BASIC Schedule library + +
+ +
+
+ GlobalScope.BasicLibraries.LoadLibrary("Schedule")
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03/lib_script.xhp b/helpcontent2/source/text/sbasic/shared/03/lib_script.xhp new file mode 100644 index 000000000..1fabfa162 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03/lib_script.xhp @@ -0,0 +1,30 @@ + + + + + + + SCRIPTBINDINGLIBRARY Library + /text/sbasic/shared/03/lib_script.xhp + + + + The ScriptBindingLibrary Library + + BASIC ScriptBindingLibrary library + +
+ +
+
+ GlobalScope.BasicLibraries.LoadLibrary("ScriptBindingLibrary")
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03/lib_template.xhp b/helpcontent2/source/text/sbasic/shared/03/lib_template.xhp new file mode 100644 index 000000000..f7e093fa0 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03/lib_template.xhp @@ -0,0 +1,28 @@ + + + + + + + TEMPLATE Library + /text/sbasic/shared/03/lib_template.xhp + + + + The Template Library + +
+ +
+
+ GlobalScope.BasicLibraries.LoadLibrary("Template")
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03/lib_tools.xhp b/helpcontent2/source/text/sbasic/shared/03/lib_tools.xhp new file mode 100644 index 000000000..97a6935ae --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03/lib_tools.xhp @@ -0,0 +1,1600 @@ + + + + + + + Tools Library + /text/sbasic/shared/03/lib_tools.xhp + + + + The Tools Library + + BASIC Tools library + +
+ +
+
+ GlobalScope.BasicLibraries.LoadLibrary("Tools")
+ Debug Module + ListBox Module + Misc Module + ModuleControls Module + Strings Module + UCB Module + + BASIC Tools library;Debug module + +
+ Debug Module + Functions and subroutines for debugging Basic macros. + + + + Macro + + + Calling parameters and comments + + + + + ActivateReadOnlyFlag + + + + Sub ActivateReadOnlyFlag() + + + + + + DeactivateReadOnlyFlag + + + + Sub DeactivateReadOnlyFlag() + + + + + + SetBasicReadOnlyFlag + + + + Sub SetBasicReadOnlyFlag(bReadOnly as Boolean) + + + + + + WritedbgInfo + + + + Sub WritedbgInfo(LocObject as Object) + + + + + + WriteDbgString + + + + Sub WriteDbgString(LocString as String) + + + + + + ShowArray + + + + Sub ShowArray(LocArray()) + + + + + + ShowPropertyValues + + + + Sub ShowPropertyValues(oLocObject as Object) + + + + + + ShowNameValuePair + + + + Sub ShowNameValuePair(Pair()) + + + + + + ShowElementNames + + + ' Retrieves all the Elements of aSequence of an object, with the + ' possibility to define a filter(sfilter <> "") + + Sub ShowElementNames( + oLocElements() as Object, + Optional sFiltername as String) + + + + + + ShowSupportedServiceNames + + + ' Retrieves all the supported servicenames of an object, with the + ' possibility to define a filter(sfilter <> "") + + Sub ShowSupportedServiceNames( + oLocObject as Object, + Optional sFilterName as String) + + + + + + ShowAvailableServiceNames + + + ' Retrieves all the available Servicenames of an object, with the + ' possibility to define a filter(sfilter <> "") + + Sub ShowAvailableServiceNames( + oLocObject as Object, + Optional sFilterName as String) + + + + + + ShowCommands + + + + Sub ShowCommands(oLocObject as Object) + + + + + + ProtectCurrentSheets + + + + Sub ProtectCurrentSheets() + + + + + + FillDocument + + + + Sub FillDocument() + + + +
+
+ + BASIC Tools library;ListBox module + +
+ ListBox Module + Functions and subroutines for handling ListBox elements. + +
+ + BASIC Tools library;Misc module + +
+ Misc Module + Miscellaneous functions and subroutines. + + + + + + + + + + + + RegisterNewDataSource + + + + Function RegisterNewDataSource( + DSName as String, + PropertyList(), + Optional DriverProperties() + as New com.sun.star.beans.PropertyValue) + + + + + + ConnecttoDatabase + + + + Function ConnecttoDatabase( + DSName as String, + UserID as String, + Password as String, + Optional Propertylist(), + Optional DriverProperties() + as New com.sun.star.beans.PropertyValue) + + + + + + GetStarOfficeLocale + + + + Function GetStarOfficeLocale() + as New com.sun.star.lang.Locale + + + + + + GetRegistryKeyContent + + + + Function GetRegistryKeyContent( + sKeyName as string, + Optional bforUpdate as Boolean) + + + + + + GetProductname + + + + Function GetProductname() as String + + + + + + OpenDocument + + + ' Opens a Document, checks beforehand, whether it has to be loaded or whether it is already on the desktop. If the parameter bDisposable is set to False then the returned document should not be disposed afterwards, because it is already opened. + + Function OpenDocument( + DocPath as String, + Args(), + Optional bDisposable as Boolean) + + + + + + TaskonDesktop + + + + Function TaskonDesktop(DocPath as String) as Boolean + + + + + + RetrieveFileName + + + ' Retrieves a FileName out of a StarOffice-Document. + + Function RetrieveFileName(LocDoc as Object) + + + + + + GetPathSettings + + + ' Gets a special configured PathSetting. + + Function GetPathSettings( + sPathType as String, + Optional bshowall as Boolean, + Optional ListIndex as integer) as String + + + + + + GetOfficeSubPath + + + ' Gets the fully qualified path to a subdirectory of the Template Directory, e. g. with the parameter "wizard/bitmap". The parameter must be passed over in Url-scription. The return-Value is in Urlscription. + + Function GetOfficeSubPath( + sOfficePath as String, + ByVal sSubDir as String) + + + + + + ShowNoOfficePathError + + + + Sub ShowNoOfficePathError() + + + + + + InitResources + + + + Function InitResources( + Description, + ShortDescription as String) as boolean + + + + + + GetResText + + + + Function GetResText( nID as integer ) As string + + + + + + CutPathView + + + + Function CutPathView( + sDocUrl as String, + Optional PathLen as Integer) + + + + + + DeleteInputCells + + + ' Deletes the content of all cells that are softformatted according to the 'InputStyleName'. + + Sub DeleteInputCells( + oSheet as Object, + InputStyleName as String) + + + + + + ChangeValueofRange + + + ' Inserts a certain String to all cells of a Range that ist passed over either as an object or as the RangeName. + + Sub ChangeValueofRange( + oSheet as Object, + Range, + ReplaceValue, + Optional StyleName as String) + + + + + + ReplaceRangeValues + + + + Sub ReplaceRangeValues( + oRange as Object, + ReplaceValue) + + + + + + GetValueofCellbyName + + + ' Returns the Value of the first cell of a Range. + + Function GetValueofCellbyName( + oSheet as Object, + sCellName as String) + + + + + + DuplicateRow + + + + Function DuplicateRow( + oSheet as Object, + RangeName as String) + + + + + + GetStringofCellbyName + + + ' Returns the String of the first cell of a Range. + + Function GetStringofCellbyName( + oSheet as Object, + sCellName as String) + + + + + + GetCellByName + + + ' Returns a named Cell + + Function GetCellByName( + oSheet as Object, + sCellName as String) as Object + + + + + + ChangeCellValue + + + ' Changes the numeric Value of a cell by transmitting the String of the numeric Value. + + Sub ChangeCellValue( + oCell as Object, + ValueString as String) + + + + + + GetDocumentType + + + + Function GetDocumentType(oDocument) + + + + + + GetNumberFormatType + + + + Function GetNumberFormatType( + oDocFormats, + oFormatObject as Object) as Integer + + + + + + ProtectSheets + + + + Sub ProtectSheets(Optional oSheets as Object) + + + + + + UnprotectSheets + + + + Sub UnprotectSheets(Optional oSheets as Object) + + + + + + GetRowIndex + + + + Function GetRowIndex( + oSheet as Object, + RowName as String) + + + + + + GetColumnIndex + + + + Function GetColumnIndex( + oSheet as Object, + ColName as String) + + + + + + CopySheetbyName + + + + Function CopySheetbyName( + oSheets as Object, + OldName as String, + NewName as String, + DestPos as Integer) as Object + + + + + + ToggleWindow + + + ' Dis-or enables a Window and adjusts the mousepointer accordingly + + Sub ToggleWindow(bDoEnable as Boolean) + + + + + + CheckNewSheetname + + + + Function CheckNewSheetname( + oSheets as Object, + Sheetname as String, + Optional oLocale) as String + + + + + + AddNewSheetName + + + + Sub AddNewSheetName( + oSheets as Object, + ByVal SheetName as String) + + + + + + GetSheetIndex + + + + Function GetSheetIndex(oSheets, sName) as Integer + + + + + + GetLastUsedRow + + + + Function GetLastUsedRow(oSheet as Object) as Integer + + + + + + ModifyBorderLineWidth + + + ' Note To set a one lined frame you have to set the inner width to 0 In the API all Units that refer to pt-Heights are "1/100mm" The convert factor from 1pt to 1/100 mm is approximately 35 + + Function ModifyBorderLineWidth( + ByVal oStyleBorder, + iInnerLineWidth as Integer, + iOuterLineWidth as Integer) + + + + + + AttachBasicMacroToEvent + + + + Sub AttachBasicMacroToEvent( + oDocument as Object, + EventName as String, + SubPath as String) + + + + + + ModifyPropertyValue + + + + Function ModifyPropertyValue( + oContent() as New com.sun.star.beans.PropertyValue, + TargetProperties() + as New com.sun.star.beans.PropertyValue) + + + + + + GetPropertyValueIndex + + + + Function GetPropertyValueIndex( + SearchName as String, + TargetProperties() + as New com.sun.star.beans.PropertyValue ) as Integer + + + + + + DispatchSlot + + + + Sub DispatchSlot(SlotID as Integer) + + + + + + IsFatOffice + + + 'returns the type of the office application FatOffice = 0, WebTop = 1 This routine has to be changed if the Product Name is being changed! + + Function IsFatOffice() As Boolean + + + + + + GetLocale + + + + Function GetLocale( + sLanguage as String, + sCountry as String) + + + + + + ToggleDesignMode + + + + Sub ToggleDesignMode(oDocument as Object) + + + + + + isHighContrast + + + + Function isHighContrast(oPeer as Object) + + + + + + CreateNewDocument + + + + Function CreateNewDocument( + sType as String, + Optional sAddMsg as String) as Object + + + + + + DisposeDocument + + + ' This Sub has been used in order to ensure that after disposing a document from the backing window it is returned to the backing window, so the office won't be closed + + Sub DisposeDocument(oDocument as Object) + + + + + + CalIsLeapYear + + + 'Function to calculate if the year is a leap year + + Function CalIsLeapYear( + ByVal iYear as Integer) as Boolean + + + +
+
+ + BASIC Tools library;ModuleControl module + +
+ ModuleControls Module + Functions and subroutines for module control. + + + + + + + + + + + + GetControlShape + + + ' Gets the Shape of a Control( e. g. to reset the size or Position of the control + ' Parameters: + ' The 'oContainer' is the Document or a specific sheet of a Calc - Document + ' 'CName' is the Name of the Control + + Function GetControlShape( + oContainer as Object, + CName as String) + + + + + + getControlView + + + ' Returns the View of a Control + ' Parameters: + ' The 'oContainer' is the Document or a specific sheet of a Calc - Document + ' The 'oController' is always directly attached to the Document + ' 'CName' is the Name of the Control + + Function getControlView( + oContainer , + oController as Object, + CName as String) as Object + + + + + + DisposeControl + + + ' Parameters: + ' The 'oContainer' is the Document or a specific sheet of a Calc - Document + ' 'CName' is the Name of the Control + + Function DisposeControl( + oContainer as Object, + CName as String) as Boolean + + + + + + GetControlGroupModel + + + ' Returns a sequence of a group of controls like option buttons or checkboxes + ' The 'oContainer' is the Document or a specific sheet of a Calc - Document + ' 'sGroupName' is the Name of the Controlgroup + + Function GetControlGroupModel( + oContainer as Object, + sGroupName as String ) + + + + + + GetRefValue + + + ' Returns the Referencevalue of a group of e.g. option buttons or check boxes + ' 'oControlGroup' is a sequence of the Control objects + + Function GetRefValue( + oControlGroup() as Object) + + + + + + GetRefValueOfControlGroup + + + + Function GetRefValueOfControlGroup( + oContainer as Object, + GroupName as String) + + + + + + GetOptionGroupValue + + + + Function GetOptionGroupValue( + oContainer as Object, + OptGroupName as String) as Boolean + + + + + + WriteOptValueToCell + + + + Function WriteOptValueToCell( + oSheet as Object, + OptGroupName as String, + iCol as Integer, + iRow as Integer) as Boolean + + + + + + LoadDialog + + + + Function LoadDialog( + Libname as String, + DialogName as String, + Optional oLibContainer) + + Refer to Opening a Dialog with Basic for an example of LoadDialog function. + + + + + GetFolderName + + + + Sub GetFolderName(oRefModel as Object) + + + + + + GetFileName + + + + Sub GetFileName( + oRefModel as Object, + Filternames()) + + + + + + StoreDocument + + + + Function StoreDocument( + oDocument as Object, + FilterNames() as String, + DefaultName as String, + DisplayDirectory as String, + Optional iAddProcedure as Integer) as String + + + + + + AddFiltersToDialog + + + + Sub AddFiltersToDialog( + FilterNames() as String, + oDialog as Object) + + + + + + SwitchMousePointer + + + + Sub SwitchMousePointer( + oWindowPeer as Object, + bDoEnable as Boolean) + + + + + + ShowOverwriteAllDialog + + + + Sub ShowOverwriteAllDialog( + FilePath as String, + sTitle as String) + + + + + + SetOVERWRITEToQuery + + + + Sub SetOVERWRITEToQuery() + + + + + + SetOVERWRITEToAlways + + + + Sub SetOVERWRITEToAlways() + + + + + + SetOVERWRITEToNever + + + + Sub SetOVERWRITEToNever() + + + +
+
+ + BASIC Tools library;Strings module + +
+ Strings Module + Advanced functions and subroutines for string manipulation. + + + + + + + + + + + + ElimChar + + + + Function ElimChar( + ByVal BigString as String, + ElimArray() as String) + + + + + + DeleteStr + + + ' Deletes out of a String 'BigString' a possible Partstring 'CompString' + + Function DeleteStr( + ByVal BigString, + CompString as String) as String + + + + + + FindPartString + + + ' Finds a PartString, that is framed by the Strings 'Prestring' and 'PostString' + + Function FindPartString( + BigString, + PreString, + PostString as String, + SearchPos as Integer) as String + + + + + + PartStringInArray + + + ' Note iCompare = 0 (Binary comparison) + ' iCompare = 1 (Text comparison) + + Function PartStringInArray( + BigArray(), + SearchString as String, + iCompare as Integer) as Integer + + + + + + RTrimStr + + + ' Deletes the String 'SmallString' out of the String 'BigString' + ' in case SmallString's Position in BigString is right at the end + + Function RtrimStr( + ByVal BigString, + SmallString as String) as String + + + + + + LTRimChar + + + ' Deletes the Char 'CompChar' out of the String 'BigString' + ' in case CompChar's Position in BigString is right at the beginning + + Function LTRimChar( + ByVal BigString as String, + CompChar as String) as String + + + + + + ArrayOutOfString + + + ' Retrieves an Array out of a String. + ' The fields of the Array are separated by the parameter 'Separator', that is contained + ' in the Array + ' The Array MaxIndex delivers the highest Index of this Array + + Function ArrayOutOfString( + BigString, + Separator as String, + Optional MaxIndex as Integer) + + + + + + ClearArray + + + ' Deletes all fieldvalues in one-dimensional Array + + Sub ClearArray(BigArray) + + + + + + ClearMultiDimArray + + + ' Deletes all fieldvalues in a multidimensional Array + + Sub ClearMultiDimArray( + BigArray, + DimCount as integer) + + + + + + FieldinArray + + + ' Checks if a Field (LocField) is already defined in an Array + ' Returns 'True' or 'False' + + Function FieldinArray( + LocArray(), + MaxIndex as integer, + LocField as String) As Boolean + + + + + + FieldinList + + + ' Checks if a Field (LocField) is already defined in an Array + ' Returns 'True' or 'False' + + Function FieldinList( + LocField, + BigList()) As Boolean + + + + + + IndexinArray + + + ' Retrieves the Index of the delivered String 'SearchString' in + ' the Array LocList()' + + Function IndexinArray( + SearchString as String, + LocList()) as Integer + + + + + + MultiArrayInListbox + + + + Sub MultiArrayInListbox( + oDialog as Object, + ListboxName as String, + ValList(), + iDim as Integer) + + + + + + StringInMultiArray + + + ' Searches for a String in a two-dimensional Array by querying all Searchindexes of the second dimension + ' and delivers the specific String of the ReturnIndex in the second dimension of the Searchlist() + + Function StringInMultiArray( + SearchList(), + SearchString as String, + SearchIndex as Integer, + ReturnIndex as Integer, + Optional MaxIndex as Integer) as String + + + + + + GetIndexInMultiArray + + + ' Searches for a Value in multidimensial Array by querying all Searchindices of the passed dimension + ' and delivers the Index where it is found. + + Function GetIndexInMultiArray( + SearchList(), + SearchValue, + SearchIndex as Integer) as Integer + + + + + + GetIndexForPartString_ + inMultiArray + + + ' Searches for a Value in multidimensial Array by querying all Searchindices of the passed dimension + ' and delivers the Index where the Searchvalue is found as a part string + + Function GetIndexForPartStringinMultiArray( + SearchList(), + SearchValue, + SearchIndex as Integer) as Integer + + + + + + ArrayfromMultiArray + + + + Function ArrayfromMultiArray( + MultiArray as String, + iDim as Integer) + + + + + + ReplaceString + + + ' Replaces the string "OldReplace" through the String "NewReplace" in the String + ' 'BigString' + + Function ReplaceString( + ByVal Bigstring, + NewReplace, + OldReplace as String) as String + + + + + + FindSecondValue + + + ' Retrieves the second value for a next to 'SearchString' in + ' a two-dimensional string-Array + + Function FindSecondValue( + SearchString as String, + TwoDimList() as String ) as String + + + + + + Power + + + ' raises a base to a certain power + + Function Power( + Basis as Double, + Exponent as Double) as Double + + + + + + Round + + + ' rounds a Real to a given Number of Decimals + + Function Round( + BaseValue as Double, + Decimals as Integer) as Double + + + + + + FileNameoutofPath + + + 'Retrieves the mere filename out of a whole path + + Function FileNameoutofPath( + ByVal Path as String, + Optional Separator as String) as String + + + + + + GetFileNameExtension + + + + Function GetFileNameExtension( + ByVal FileName as String) + + + + + + GetFileNameWithoutExtension + + + + Function GetFileNameWithoutExtension( + ByVal FileName as String, + Optional Separator as String) + + + + + + DirectoryNameoutofPath + + + + Function DirectoryNameoutofPath( + sPath as String, + Separator as String) as String + + + + + + CountCharsinString + + + + Function CountCharsinString( + BigString, + LocChar as String, + ByVal StartPos as Integer) as Integer + + + + + + BubbleSortList + + + + Function BubbleSortList( + ByVal SortList(), + optional sort2ndValue as Boolean) + + 'This function bubble sorts an array of maximum 2 dimensions. + 'The default sorting order is the first dimension + 'Only if sort2ndValue is True the second dimension is the relevant for the sorting order + + + + + GetValueoutofList + + + + Function GetValueoutofList( + SearchValue, + BigList(), + iDim as Integer, + Optional ValueIndex) + + + + + + AddListtoList + + + + Function AddListtoList( + ByVal FirstArray(), + ByVal SecondArray(), + Optional StartIndex) + + + + + + CheckDouble + + + + Function CheckDouble(DoubleString as String) + + + +
+
+ + BASIC Tools library;UCB module + +
+ UCB Module + Universal Content Broker functions and subroutines. + + + + + + + + + + + + ReadDirectories + + + + Function ReadDirectories( + ByVal AnchorDir As String, + bRecursive as Boolean, + bcheckFileType as Boolean, + bGetByTitle as Boolean, + Optional sFileContent(), + Optional sExtension as String) + + + + + + AddFoldertoList + + + + Sub AddFoldertoList( + sDirURL as String, + iDirIndex) + + + + + + AddFileNameToList + + + + Sub AddFileNameToList( + sFileArray(), + FileName as String, + FileContent as String, + bGetByTitle as Boolean, + CurIndex) + + + + + + RetrieveDocTitle + + + + Function RetrieveDocTitle( + oDocProps as Object, + sFileName as String) As String + + + + + + GetRealFileContent + + + ' Retrieves The Filecontent of a Document by extracting the content + ' from the Header of the document + + Function GetRealFileContent( + FileName as String) As String + + + + + + CopyRecursively + + + + Function CopyRecursively( + SourceFilePath as String, + SourceStemDir as String, + TargetStemDir as String) + + + + + + ShowHelperDialog + + + ' Opens a help url referenced by a Help ID that is retrieved from the calling button tag + + Sub ShowHelperDialog(aEvent) + + + + + + SaveDataToFile + + + + Sub SaveDataToFile( + FilePath as String, + DataList()) + + + + + + LoadDataFromFile + + + + Function LoadDataFromFile( + FilePath as String, + DataList()) as Boolean + + + + + + CreateFolder + + + + Function CreateFolder(sNewFolder) as Boolean + + + +
+
+
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03000000.xhp b/helpcontent2/source/text/sbasic/shared/03000000.xhp new file mode 100644 index 000000000..46d180104 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03000000.xhp @@ -0,0 +1,51 @@ + + + + + + + Run-Time Functions + /text/sbasic/shared/03000000.xhp + + + + + + +
+ +Run-Time Functions +This section describes the Runtime Functions of %PRODUCTNAME Basic. +
+ + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03010000.xhp b/helpcontent2/source/text/sbasic/shared/03010000.xhp new file mode 100644 index 000000000..60039275d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010000.xhp @@ -0,0 +1,41 @@ + + + + + + + + +Screen I/O Functions +/text/sbasic/shared/03010000.xhp + + +Sun Microsystems, Inc. + + + +
+

Screen I/O Functions

+ This section describes the Runtime Functions used to call dialogs for the input and output of user entries. +
+ + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03010100.xhp b/helpcontent2/source/text/sbasic/shared/03010100.xhp new file mode 100644 index 000000000..f9fb1bb0f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010100.xhp @@ -0,0 +1,43 @@ + + + + + + + + +Display Functions +/text/sbasic/shared/03010100.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Display Functions + This section describes Runtime functions used to output information to the screen display. +
+ + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03010101.xhp b/helpcontent2/source/text/sbasic/shared/03010101.xhp new file mode 100644 index 000000000..095976844 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010101.xhp @@ -0,0 +1,223 @@ + + + + + + + MsgBox Statement + /text/sbasic/shared/03010101.xhp + + + + + + +
+ + MsgBox statement + + + +MsgBox Statement +Displays a dialog box containing a message. +
+ +Syntax: + +MsgBox Text As String [,Type As Integer [,Dialogtitle As String]] (As Statement) or MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) (As Function) + + +Parameter: + Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13). + DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application. + Type: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. Type represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values: + + + + + Named constant + + + Integer value + + + Definition + + + + + MB_OK + + + 0 + + + Display OK button only. + + + + + MB_OKCANCEL + + + 1 + + + Display OK and Cancel buttons. + + + + + MB_ABORTRETRYCANCEL + + + 2 + + + Display Abort, Retry, and Ignore buttons. + + + + + MB_YESNOCANCEL + + + 3 + + + Display Yes, No, and Cancel buttons. + + + + + MB_YESNO + + + 4 + + + Display Yes and No buttons. + + + + + MB_RETRYCANCEL + + + 5 + + + Display Retry and Cancel buttons. + + + + + MB_ICONSTOP + + + 16 + + + Add the Stop icon to the dialog. + + + + + MB_ICONQUESTION + + + 32 + + + Add the Question icon to the dialog. + + + + + MB_ICONEXCLAMATION + + + 48 + + + Add the Exclamation Point icon to the dialog. + + + + + MB_ICONINFORMATION + + + 64 + + + Add the Information icon to the dialog. + + + + + + + + 128 + + + First button in the dialog as default button. + + + + + MB_DEFBUTTON2 + + + 256 + + + Second button in the dialog as default button. + + + + + MB_DEFBUTTON3 + + + 512 + + + Third button in the dialog as default button. + + +
+ + + + +Example: + +Sub ExampleMsgBox + Const sText1 = "An unexpected error occurred." + Const sText2 = "The program execution will continue, however." + Const sText3 = "Error" + MsgBox(sText1 + Chr(13) + sText2,16,sText3) + MsgBox(sText1 + Chr(13) + sText2, MB_ICONSTOP, sText3) +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03010102.xhp b/helpcontent2/source/text/sbasic/shared/03010102.xhp new file mode 100644 index 000000000..68eeba306 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010102.xhp @@ -0,0 +1,320 @@ + + + + + + + MsgBox Function + /text/sbasic/shared/03010102.xhp + + + + + + +
+ + MsgBox function + + + +MsgBox Function +Displays a dialog box containing a message and returns a value. +
+ +Syntax: + +MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) + + +Return value: +Integer + +Parameter: + Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13). + DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the name of the respective application is displayed. + Type: Any integer expression that specifies the dialog type and defines the number and type of buttons or icons displayed. Type represents a combination of bit patterns (dialog elements defined by adding the respective values): + Values + + + + + Named constant + + + Integer value + + + Definition + + + + + MB_OK + + + 0 + + + Display OK button only. + + + + + MB_OKCANCEL + + + 1 + + + Display OK and Cancel buttons. + + + + + MB_ABORTRETRYCANCEL + + + 2 + + + Display Abort, Retry, and Ignore buttons. + + + + + MB_YESNOCANCEL + + + 3 + + + Display Yes, No, and Cancel buttons. + + + + + MB_YESNO + + + 4 + + + Display Yes and No buttons. + + + + + MB_RETRYCANCEL + + + 5 + + + Display Retry and Cancel buttons. + + + + + MB_ICONSTOP + + + 16 + + + Add the Stop icon to the dialog. + + + + + MB_ICONQUESTION + + + 32 + + + Add the Question icon to the dialog. + + + + + MB_ICONEXCLAMATION + + + 48 + + + Add the Exclamation Point icon to the dialog. + + + + + MB_ICONINFORMATION + + + 64 + + + Add the Information icon to the dialog. + + + + + + + + 128 + + + First button in the dialog as default button. + + + + + MB_DEFBUTTON2 + + + 256 + + + Second button in the dialog as default button. + + + + + MB_DEFBUTTON3 + + + 512 + + + Third button in the dialog as default button. + + +
+ + Return value: + + + + + Named constant + + + Integer value + + + Definition + + + + + IDOK + + + 1 + + + OK + + + + + IDCANCEL + + + 2 + + + Cancel + + + + + IDABORT + + + 3 + + + Abort + + + + + IDRETRY + + + 4 + + + Retry + + + + + IDIGNORE + + + 5 + + + Ignore + + + + + IDYES + + + 6 + + + Yes + + + + + IDNO + + + 7 + + + No + + +
+ + + + +Example: + +Sub ExampleMsgBox +Dim sVar As Integer + sVar = MsgBox("Las Vegas") + sVar = MsgBox("Las Vegas",1) + sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title") + sVar = MsgBox("Las Vegas", MB_DEFBUTTON2 + MB_ICONSTOP + MB_ABORTRETRYCANCEL, "Dialog title") +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03010103.xhp b/helpcontent2/source/text/sbasic/shared/03010103.xhp new file mode 100644 index 000000000..52cccd7ec --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010103.xhp @@ -0,0 +1,90 @@ + + + + + + + Print Statement + /text/sbasic/shared/03010103.xhp + + + + + + +
+ + Print statement + Print statement; Tab function + Print statement; Spc function + Spc function; in Print statement + Tab function; in Print statement + + + +Print Statement +Outputs the specified strings or numeric expressions to a dialog or to a file. +
+ + +Print syntax + +Print [#filenum,] expression1[{;|,} [Spc(number As Integer);] [Tab(pos As Integer);] [expression2[...]] + + + + filenum: Any numeric expression that contains the file number that was set by the Open statement for the respective file.see i61758 + expression: Any numeric or string expression to be printed. Multiple expressions can be separated by a semicolon. If separated by a comma, the expressions are indented to the next tab stop. The tab stops cannot be adjusted. + number: Number of spaces to be inserted by the Spc function. + pos: Spaces are inserted until the specified position. +If a semicolon or comma appears after the last expression to be printed, $[officename] Basic stores the text in an internal buffer and continues program execution without printing. When another Print statement without a semicolon or comma at the end is encountered, all text to be printed is printed at once. +Positive numeric expressions are printed with a leading space. Negative expressions are printed with a leading minus sign. If a certain range is exceeded for floating-point values, the respective numeric expression is printed in exponential notation. +If the expression to be printed exceeds a certain length, the display will automatically wrap to the next line. +You can insert the Tab function, enclosed by semicolons, between arguments to indent the output to a specific position, or you can use the Spc function to insert a specified number of spaces. + + + + + +Sub ExamplePrint + Print "ABC" + Print "ABC","123" + i = FreeFile() + Open "C:\Temp.txt" For Output As i + Print #i, "ABC" + Close #i +End Sub + + + + +Sub ExamplePrint + Print "ABC" + Print "ABC","123" + i = FreeFile() + Open "~/temp.txt" For Output As i + Print #i, "ABC" + Close #i +End Sub + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03010200.xhp b/helpcontent2/source/text/sbasic/shared/03010200.xhp new file mode 100644 index 000000000..5464dbaf0 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010200.xhp @@ -0,0 +1,41 @@ + + + + + + + + +Functions for Screen Input +/text/sbasic/shared/03010200.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Functions for Screen Input + This section describes Runtime functions used to control screen input. +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03010201.xhp b/helpcontent2/source/text/sbasic/shared/03010201.xhp new file mode 100644 index 000000000..353d6a442 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010201.xhp @@ -0,0 +1,68 @@ + + + + + + + InputBox Function + /text/sbasic/shared/03010201.xhp + + + + + + +
+ + InputBox function + + + +InputBox Function +Displays a prompt in a dialog at which the user can input text. The input is assigned to a variable. +
+The InputBox statement is a convenient method of entering text through a dialog. Confirm the input by clicking OK or pressing Return. The input is returned as the function return value. If you close the dialog with Cancel, InputBox returns a zero-length string (""). + +Syntax: + +InputBox (Msg As String[, Title As String[, Default As String[, x_pos As Integer, y_pos As Integer]]]]) + + +Return value: +String + +Parameter: + Msg: String expression displayed as the message in the dialog box. + Title: String expression displayed in the title bar of the dialog box. + Default: String expression displayed in the text box as default if no other input is given. + x_pos: Integer expression that specifies the horizontal position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application. + y_pos: Integer expression that specifies the vertical position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application. +If x_pos and y_pos are omitted, the dialog is centered on the screen. The position is specified in twips. + +Example: + +Sub ExampleInputBox +Dim sText As String + sText = InputBox ("Please enter a phrase:","Dear User") + MsgBox ( sText , 64, "Confirmation of phrase") +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03010300.xhp b/helpcontent2/source/text/sbasic/shared/03010300.xhp new file mode 100644 index 000000000..0e06f5dc3 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010300.xhp @@ -0,0 +1,45 @@ + + + + + + + + +Color Functions +/text/sbasic/shared/03010300.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Color Functions + This section describes Runtime functions used to define colors. +
+ + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03010301.xhp b/helpcontent2/source/text/sbasic/shared/03010301.xhp new file mode 100644 index 000000000..7fd30d055 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010301.xhp @@ -0,0 +1,68 @@ + + + + + + + Blue Function + /text/sbasic/shared/03010301.xhp + + + + + + +
+ + Blue function + + + +Blue Function +Returns the blue component of the specified composite color code. +
+ +Syntax: + +Blue (Color As Long) + + +Return value: +Integer + +Parameter: + Color value: Long integer expression that specifies any composite color code for which to return the blue component. + + + + +Example: + +Sub ExampleColor +Dim lVar As Long + lVar = rgb(128,0,200) + MsgBox "The color " & lVar & " consists of:" & Chr(13) &_ + "red= " & Red(lVar) & Chr(13)&_ + "green= " & Green(lVar) & Chr(13)&_ + "blue= " & Blue(lVar) & Chr(13) , 64,"colors" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03010302.xhp b/helpcontent2/source/text/sbasic/shared/03010302.xhp new file mode 100644 index 000000000..f5630fde7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010302.xhp @@ -0,0 +1,68 @@ + + + + + + + Green Function + /text/sbasic/shared/03010302.xhp + + + + + + +
+ + Green function + + + +Green Function +Returns the Green component of the given composite color code. +
+ +Syntax: + +Green (Color As Long) + + +Return value: +Integer + +Parameter: + Color: Long integer expression that specifies a composite color code for which to return the Green component. + + + + +Example: + +Sub ExampleColor +Dim lVar As Long + lVar = rgb(128,0,200) + MsgBox "The color " & lVar & " contains the components:" & Chr(13) &_ + "red = " & red(lVar) & Chr(13)&_ + "green = " & green(lVar) & Chr(13)&_ + "blue = " & blue(lVar) & Chr(13) , 64,"colors" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03010303.xhp b/helpcontent2/source/text/sbasic/shared/03010303.xhp new file mode 100644 index 000000000..1dfc411f0 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010303.xhp @@ -0,0 +1,71 @@ + + + + + + + Red Function + /text/sbasic/shared/03010303.xhp + + + + + + +
+ + Red function + + + +Red Function +Returns the Red component of the specified composite color code. +
+ +Syntax: + +Red (ColorNumber As Long) + + +Return value: +Integer + +Parameter: + ColorNumber: Long integer expression that specifies any composite color code for which to return the Red component. + + + +
+ The color picker dialog details the red, green and blue components of a composite color code, as well as its hexadecimal expression. Changing the color of text and selecting Custom color displays the color picker dialog. +
+ +Example: + +Sub ExampleColor +Dim lVar As Long + lVar = rgb(128,0,200) + MsgBox "The color " & lVar & " consists of:" & Chr(13) &_ + "red= " & red(lVar) & Chr(13)&_ + "green= " & green(lVar) & Chr(13)&_ + "blue= " & blue(lVar) & Chr(13) , 64,"colors" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03010304.xhp b/helpcontent2/source/text/sbasic/shared/03010304.xhp new file mode 100644 index 000000000..2e78f7ccf --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010304.xhp @@ -0,0 +1,80 @@ + + + + + + + QBColor Function + /text/sbasic/shared/03010304.xhp + + + + + +
+ + QBColor function + + +QBColor Function +Returns the RGB color code of the color passed as a color value through an older MS-DOS based programming system. +
+ +Syntax: +QBColor (ColorNumber As Integer) + +Return value: +Long + +Parameter: + ColorNumber: Any integer expression that specifies the color value of the color passed from an older MS-DOS based programming system. + ColorNumber can be assigned the following values: +0 : Black +1 : Blue +2 : Green +3 : Cyan +4 : Red +5 : Magenta +6 : Yellow +7 : White +8 : Gray +9 : Light Blue +10 : Light Green +11 : Light Cyan +12 : Light Red +13 : Light Magenta +14 : Light Yellow +15 : Bright White +This function is used only to convert from older MS-DOS based BASIC applications that use the above color codes. The function returns a long integer value indicating the color to be used in the $[officename] IDE. + + + +Example: + +Sub ExampleQBColor +Dim iColor As Integer +Dim sText As String + iColor = 7 + sText = "RGB= " & Red(QBColor( iColor) ) & ":" & Blue(QBColor( iColor) ) & ":" & Green(QBColor( iColor) ) + MsgBox stext,0,"Color " & iColor +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03010305.xhp b/helpcontent2/source/text/sbasic/shared/03010305.xhp new file mode 100644 index 000000000..337e07992 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03010305.xhp @@ -0,0 +1,71 @@ + + + + + + + RGB Function + /text/sbasic/shared/03010305.xhp + + + + + + +
+ + RGB function + + +RGB Function + Returns a Long integer color value consisting of red, green, and blue components. +
+ +Syntax: + +RGB (Red, Green, Blue) + + +Return value: +Long + +Parameter: + Red: Any integer expression that represents the red component (0-255) of the composite color. + Green: Any integer expression that represents the green component (0-255) of the composite color. + Blue: Any integer expression that represents the blue component (0-255) of the composite color. +The color picker dialog helps computing red, green and blue components of a composite color. Changing the color of text and selecting Custom color displays the color picker dialog. + + + + +Example: + +Sub ExampleColor +Dim lVar As Long + lVar = rgb(128,0,200) + MsgBox "The color " & lVar & " consists of:" & Chr(13) &_ + "red= " & red(lVar) & Chr(13)&_ + "green= " & green(lVar) & Chr(13)&_ + "blue= " & blue(lVar) & Chr(13) , 64,"colors" +End Sub + + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020000.xhp b/helpcontent2/source/text/sbasic/shared/03020000.xhp new file mode 100644 index 000000000..f4d1cb285 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020000.xhp @@ -0,0 +1,42 @@ + + + + + + + + +File I/O Functions +/text/sbasic/shared/03020000.xhp + + +Sun Microsystems, Inc. + + + +
+File I/O Functions +Use File I/O functions to create and manage user-defined (data) files. +
+You can use these functions to support the creation of "relative" files, so that you can save and reload certain records by specifying their record number. File I/O functions can also help you manage your files by providing you with information such as file size, current path settings, or the creation date of a file or a directory. + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020100.xhp b/helpcontent2/source/text/sbasic/shared/03020100.xhp new file mode 100644 index 000000000..a23a1242e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020100.xhp @@ -0,0 +1,41 @@ + + + + + + + + +Opening and Closing Files +/text/sbasic/shared/03020100.xhp + + +Sun Microsystems, Inc. + + + +
+Opening and Closing Files +
+ + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020101.xhp b/helpcontent2/source/text/sbasic/shared/03020101.xhp new file mode 100644 index 000000000..608027d66 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020101.xhp @@ -0,0 +1,77 @@ + + + + + + + Close Statement + /text/sbasic/shared/03020101.xhp + + + + + + +
+ + Close statement + + + +Close Statement +Closes a specified file that was opened with the Open statement. +
+ +Syntax: + +Close FileNumber As Integer[, FileNumber2 As Integer[,...]] + + +Parameters: + FileNumber: Any integer expression that specifies the number of the data channel that was opened with the Open statement. + +Example: + +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + sMsg = "" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "First line of text" + Print #iNumber, "Another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + While Not eof(iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020102.xhp b/helpcontent2/source/text/sbasic/shared/03020102.xhp new file mode 100644 index 000000000..66160f95e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020102.xhp @@ -0,0 +1,83 @@ + + + + + + + FreeFile Function + /text/sbasic/shared/03020102.xhp + + + + + + +
+ + FreeFile function + + + +FreeFile Function +Returns the next available file number for opening a file. Use this function to open a file using a file number that is not already in use by a currently open file. +
+ +Syntax: + +FreeFile + + +Return value: +Integer + +Parameters: +This function can only be used immediately in front of an Open statement. FreeFile returns the next available file number, but does not reserve it. + + + + +Example: + +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + sMsg = "" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "First line of text" + Print #iNumber, "Another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As #iNumber + While Not eof(#iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020103.xhp b/helpcontent2/source/text/sbasic/shared/03020103.xhp new file mode 100644 index 000000000..14daf4955 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020103.xhp @@ -0,0 +1,81 @@ + + + + + + + Open Statement + /text/sbasic/shared/03020103.xhp + + + + + + +
+ + Open statement + + + +

Open Statement

+Opens a data channel. +
+ + + +Open FileName As String [For Mode] [Access IOMode] [Protected] As [#]FileNumber As Integer [Len = DatasetLength]i37502 + + + + FileName: Name and path of the file to open. If you try to read a file that does not exist (Access = Read), an error message appears. If you try to write to a file that does not exist (Access = Write), a new file is created. + Mode: Keyword that specifies the file mode. Valid values: Append (append to sequential file), Binary (data can be accessed by bytes using Get and Put), Input (opens data channel for reading), Output (opens data channel for writing), and Random (edits relative files). + IOMode: Keyword that defines the access type. Valid values: Read (read-only), Write (write-only), Read Write (both). + Protected: Keyword that defines the security status of a file after opening. Valid values: Shared (file may be opened by other applications), Lock Read (file is protected against reading), Lock Write (file is protected against writing), Lock Read Write (denies file access). + FileNumber: Any integer expression from 0 to 511 to indicate the number of a free data channel. You can then pass commands through the data channel to access the file. The file number must be determined by the FreeFile function immediately before the Open statement. + DatasetLength: For random access files, set the length of the records.#61736 +You can only modify the contents of a file that was opened with the Open statement. If you try to open a file that is already open, an error message appears. + + + +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + Print #iNumber, "This is another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + While Not eof(iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020104.xhp b/helpcontent2/source/text/sbasic/shared/03020104.xhp new file mode 100644 index 000000000..d6d2074a9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020104.xhp @@ -0,0 +1,76 @@ + + + + + + + Reset Statement + /text/sbasic/shared/03020104.xhp + + + + + + +
+ + Reset statement + + + +Reset Statement +Closes all open files and writes the contents of all file buffers to the harddisk. +
+ +Syntax: + +Reset + + +Example: + +Sub ExampleReset +On Error GoTo ErrorHandler +Dim iNumber As Integer +Dim iCount As Integer +Dim sLine As String +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a new line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + For iCount = 1 To 5 + Line Input #iNumber, sLine + If sLine <>"" Then + Rem + End If + Next iCount + Close #iNumber + Exit Sub +ErrorHandler: + Reset + MsgBox "All files will be closed",0,"Error" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020200.xhp b/helpcontent2/source/text/sbasic/shared/03020200.xhp new file mode 100644 index 000000000..e2a230376 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020200.xhp @@ -0,0 +1,46 @@ + + + + + + + + +File Input/Output Functions +/text/sbasic/shared/03020200.xhp + + +Sun Microsystems, Inc. + + + +
+File Input/Output Functions +
+ + + + + + + + +see i61245 + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020201.xhp b/helpcontent2/source/text/sbasic/shared/03020201.xhp new file mode 100644 index 000000000..eb46b84dd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020201.xhp @@ -0,0 +1,84 @@ + + + + + + + Get Statement + /text/sbasic/shared/03020201.xhp + + + + + + +
+ + Get statement + + + +Get Statement +Reads a record from a relative file, or a sequence of bytes from a binary file, into a variable. +
+See also: PUT Statement + +Syntax: + +Get [#] FileNumber As Integer, [Position], Variable + + +Parameters: + FileNumber: Any integer expression that determines the file number. + Position: For files opened in Random mode, Position is the number of the record that you want to read. +For files opened in Binary mode, Position is the byte position in the file where the reading starts. +If Position is omitted, the current position or the current data record of the file is used. +Variable: Name of the variable to be read. With the exception of object variables, you can use any variable type. + +Example: + +Sub ExampleRandomAccess +Dim iNumber As Integer +Dim sText As Variant ' Must be a variant +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Seek #iNumber,1 ' Position at beginning + Put #iNumber,, "This is the first line of text" ' Fill line with text + Put #iNumber,, "This is the second line of text" + Put #iNumber,, "This is the third line of text" + Seek #iNumber,2 + Get #iNumber,,sText + Print sText + Close #iNumber + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Get #iNumber,2,sText + Put #iNumber,,"This is a new text" + Get #iNumber,1,sText + Get #iNumber,2,sText + Put #iNumber,20,"This is the text in record 20" + Print Lof(#iNumber) + Close #iNumber +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020202.xhp b/helpcontent2/source/text/sbasic/shared/03020202.xhp new file mode 100644 index 000000000..b84c2dc82 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020202.xhp @@ -0,0 +1,90 @@ + + + + + + + Input# Statement + /text/sbasic/shared/03020202.xhp + + + + + + +
+ + Input statement + + + +Input# Statement +Reads data from an open sequential file. +
+ +Syntax: +Input #FileNumber As Integer; var1[, var2[, var3[,...]]] + +Parameters: + FileNumber: Number of the file that contains the data that you want to read. The file must be opened with the Open statement using the key word INPUT. + var: A numeric or string variable that you assign the values read from the opened file to. +The Input# statement reads numeric values or strings from an open file and assigns the data to one or more variables. A numeric variable is read up to the first carriage return (Asc=13), line feed (Asc=10), space, or comma. String variables are read to up to the first carriage return (Asc=13), line feed (Asc=10), or comma. +Data and data types in the opened file must appear in the same order as the variables that are passed in the "var" parameter. If you assign non-numeric values to a numeric variable, "var" is assigned a value of "0". +Records that are separated by commas cannot be assigned to a string variable. Quotation marks (") in the file are disregarded as well. If you want to read these characters from the file, use the Line Input# statement to read pure text files (files containing only printable characters) line by line. +If the end of the file is reached while reading a data element, an error occurs and the process is aborted. + +Example: + +Sub ExampleWorkWithAFile +Dim iCount As Integer +Dim sName As String +Dim sValue As Integer +Dim sFileName As String + +sFileName = "c:\data.txt" +iCount = Freefile + +' Write data ( which we will read later with Input ) to file +Open sFileName For Output As iCount +sName = "Hamburg" +sValue = 200 +Write #iCount, sName, sValue +sName = "New York" +sValue = 300 +Write #iCount, sName, sValue +sName = "Miami" +sValue = 459 +Write #iCount, sName, sValue +Close #iCount + +iCount = Freefile +' Read data file using Input +Open sFileName For Input As iCount +Input #iCount; sName, sValue +MsgBox sName & " " & sValue +Input #iCount; sName, sValue +MsgBox sName & " " & sValue +Input #iCount; sName, sValue +MsgBox sName & " " & sValue +Close #iCount +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020203.xhp b/helpcontent2/source/text/sbasic/shared/03020203.xhp new file mode 100644 index 000000000..2bb424393 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020203.xhp @@ -0,0 +1,78 @@ + + + + + + + Line Input # Statement + /text/sbasic/shared/03020203.xhp + + + + + + +
+ + Line Input statement + + + +Line Input # Statement +Reads strings from a sequential file into a variable. +
+ +Syntax: + +Line Input #FileNumber As Integer, Var As String + + +Parameters: + FileNumber: Number of the file that contains the data that you want to read. The file must have been opened in advance with the Open statement using the key word INPUT. + var: The name of the variable that stores the result. +With the Line Input# statement, you can read strings from an open file into a variable. String variables are read line-by-line up to the first carriage return (Asc=13) or linefeed (Asc=10). Line end marks are not included in the resulting string. + +Example: + +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + Print #iNumber, "This is another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + While Not EOF(iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020204.xhp b/helpcontent2/source/text/sbasic/shared/03020204.xhp new file mode 100644 index 000000000..79a276ecd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020204.xhp @@ -0,0 +1,85 @@ + + + + + + + Put Statement + /text/sbasic/shared/03020204.xhp + + + + + + +
+ + Put statement + + + +Put Statement +Writes a record to a relative file or a sequence of bytes to a binary file. +
+See also: Get statement + +Syntax: + +Put [#] FileNumber As Integer, [position], Variable + + +Parameters: + FileNumber: Any integer expression that defines the file that you want to write to. + Position: For relative files (random access files), the number of the record that you want to write. +For binary files (binary access), the position of the byte in the file where you want to start writing. + Variable: Name of the variable that you want to write to the file. +Note for relative files: If the contents of this variable does not match the length of the record that is specified in the Len clause of the Open statement, the space between the end of the newly written record and the next record is padded with existing data from the file that you are writing to. +Note for binary files: The contents of the variables are written to the specified position, and the file pointer is inserted directly after the last byte. No space is left between the records. + +Example: + +Sub ExampleRandomAccess +Dim iNumber As Integer +Dim sText As Variant ' Must be a variant type +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Seek #iNumber,1 ' Position To start writing + Put #iNumber,, "This is the first line of text" ' Fill line with text + Put #iNumber,, "This is the second line of text" + Put #iNumber,, "This is the third line of text" + Seek #iNumber,2 + Get #iNumber,,sText + Print sText + Close #iNumber + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Get #iNumber,2,sText + Put #iNumber,,"This is new text" + Get #iNumber,1,sText + Get #iNumber,2,sText + Put #iNumber,20,"This is the text in record 20" + Print Lof(#iNumber) + Close #iNumber +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020205.xhp b/helpcontent2/source/text/sbasic/shared/03020205.xhp new file mode 100644 index 000000000..e40f57bb7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020205.xhp @@ -0,0 +1,73 @@ + + + + + + + Write Statement + /text/sbasic/shared/03020205.xhp + + + + + + +
+ + Write statement + + + +Write Statement +Writes data to a sequential file. +
+ +Syntax: + +Write [#FileName], [Expressionlist]see i61248 + + +Parameters: + FileName: Any numeric expression that contains the file number that was set by the Open statement for the respective file. + Expressionlist: Variables or expressions that you want to enter in a file, separated by commas. +If the expression list is omitted, the Write statement appends an empty line to the file. +To add an expression list to a new or an existing file, the file must be opened in the Output or Append mode. +Strings that you write are enclosed by quotation marks and separated by commas. You do not need to enter these delimiters in the expression list. +Each Write statement outputs a line end symbol as last entry. +Numbers with decimal delimiters are converted according to the locale settings. + +Example: + +Sub ExampleWrite +Dim iCount As Integer +Dim sValue As String + iCount = Freefile + Open "C:\data.txt" For Output As iCount + sValue = "Hamburg" + Write #iCount,sValue,200 + sValue = "New York" + Write #iCount,sValue,300 + sValue = "Miami" + Write #iCount,sValue,450 + Close #iCount +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020301.xhp b/helpcontent2/source/text/sbasic/shared/03020301.xhp new file mode 100644 index 000000000..b9c84f456 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020301.xhp @@ -0,0 +1,83 @@ + + + + + + + Eof Function + /text/sbasic/shared/03020301.xhp + + + + + + +
+ + Eof function + + + +Eof Function +Determines if the file pointer has reached the end of a file. +
+ +Syntax: + +Eof (intexpression As Integer) + + +Return value: +Bool + +Parameters: + Intexpression: Any integer expression that evaluates to the number of an open file. +Use EOF to avoid errors when you attempt to get input past the end of a file. When you use the Input or Get statement to read from a file, the file pointer is advanced by the number of bytes read. When the end of a file is reached, EOF returns the value "True" (-1). + + + + +Example: + +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "First line of text" + Print #iNumber, "Another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + While Not eof(iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020302.xhp b/helpcontent2/source/text/sbasic/shared/03020302.xhp new file mode 100644 index 000000000..8e93fd5b8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020302.xhp @@ -0,0 +1,54 @@ + + + + + + + + +Loc Function +/text/sbasic/shared/03020302.xhp + + +Sun Microsystems, Inc. + + + +
+Loc function + +Loc Function +Returns the current position in an open file. +
+Syntax: + +Loc(FileNumber) + +Return value: +Long +Parameters: + +FileNumber: Any numeric expression that contains the file number that is set by the Open statement for the respective file. +If the Loc function is used for an open random access file, it returns the number of the last record that was last read or written. +For a sequential file, the Loc function returns the position in a file divided by 128. For binary files, the position of the last read or written byte is returned. + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020303.xhp b/helpcontent2/source/text/sbasic/shared/03020303.xhp new file mode 100644 index 000000000..a00387724 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020303.xhp @@ -0,0 +1,81 @@ + + + + + + + + +Lof Function +/text/sbasic/shared/03020303.xhp + + +Sun Microsystems, Inc. + + + +
+Lof function + +Lof Function +Returns the size of an open file in bytes. +
+Syntax: + +Lof (FileNumber) + +Return value: +Long +Parameters: + +FileNumber: Any numeric expression that contains the file number that is specified in the Open statement. +To obtain the length of a file that is not open, use the FileLen function. + + + +Example: + +Sub ExampleRandomAccess +Dim iNumber As Integer +Dim sText As Variant REM must be a Variant +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Seek #iNumber,1 REM Position at start + Put #iNumber,, "This is the first line of text" REM Fill with text + Put #iNumber,, "This is the second line of text" + Put #iNumber,, "This is the third line of text" + Seek #iNumber,2 + Get #iNumber,,sText + Print sText + Close #iNumber + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Get #iNumber,2,sText + Put #iNumber,,"This is a new line of text" + Get #iNumber,1,sText + Get #iNumber,2,sText + Put #iNumber,20,"This is the text in record 20" + Print Lof(#iNumber) + Close #iNumber +End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020304.xhp b/helpcontent2/source/text/sbasic/shared/03020304.xhp new file mode 100644 index 000000000..0d47a77ca --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020304.xhp @@ -0,0 +1,52 @@ + + + + + + + + +Seek Function +/text/sbasic/shared/03020304.xhp + + +Sun Microsystems, Inc. + + + +
+Seek function + +Seek Function +Returns the position for the next writing or reading in a file that was opened with the open statement. +
+For random access files, the Seek function returns the number of the next record to be read. +For all other files, the function returns the byte position at which the next operation is to occur. +See also: Open, Seek. +Syntax: + +Seek (FileNumber) + +Return value: +Long +Parameters: + +FileNumber: The data channel number used in the Open statement. + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020305.xhp b/helpcontent2/source/text/sbasic/shared/03020305.xhp new file mode 100644 index 000000000..32424a100 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020305.xhp @@ -0,0 +1,53 @@ + + + + + + + + +Seek Statement +/text/sbasic/shared/03020305.xhp + + +Sun Microsystems, Inc. + + + +Seek statement + +Seek Statement +Sets the position for the next writing or reading in a file that was opened with the Open statement.see #61751 +For random access files, the Seek statement sets the number of the next record to be accessed. +For all other files, the Seek statement sets the byte position at which the next operation is to occur. +See also: Open, Seek. +Syntax: + +Seek[#FileNumber], Position (As Long) + +Parameters: + +FileNumber: The data channel number used in the Open statement. + +Position: Position for the next writing or reading. Position can be a number between 1 and 2,147,483,647. According to the file type, the position indicates the number of the record (files in the Random mode) or the byte position (files in the Binary, Output, Append or Input mode). The first byte in a file is position 1, the second byte is position 2, and so on. + + + + + diff --git a/helpcontent2/source/text/sbasic/shared/03020400.xhp b/helpcontent2/source/text/sbasic/shared/03020400.xhp new file mode 100644 index 000000000..27592c63a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020400.xhp @@ -0,0 +1,56 @@ + + + + + + + + +Managing Files +/text/sbasic/shared/03020400.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Managing Files + The functions and statements for managing files are described here. +
+ + + + + + + + + + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020401.xhp b/helpcontent2/source/text/sbasic/shared/03020401.xhp new file mode 100644 index 000000000..eea88c05f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020401.xhp @@ -0,0 +1,71 @@ + + + + + + + ChDir Statement + /text/sbasic/shared/03020401.xhp + + + + + + +
+ + ChDir statement + + + +ChDir Statement +Changes the current directory or drive. +
+ +
+This statement currently does not work as documented. See this issue for more information. +
+ +Syntax: + +ChDir Text As String + + +Parameters: + Text: Any string expression that specifies the directory path or drive. +If you only want to change the current drive, enter the drive letter followed by a colon. + + + + +Example: + +Sub ExampleChDir +Dim sDir1 As String , sDir2 As String + sDir1 = "c:\Test" + sDir2 = "d:\Private" + ChDir( sDir1 ) + MsgBox CurDir + ChDir( sDir2 ) + MsgBox CurDir +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020402.xhp b/helpcontent2/source/text/sbasic/shared/03020402.xhp new file mode 100644 index 000000000..21087ed3e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020402.xhp @@ -0,0 +1,63 @@ + + + + + + + ChDrive Statement + /text/sbasic/shared/03020402.xhp + + + + + + +
+ + ChDrive statement + + + +ChDrive Statement +Changes the current drive. +
+ + +Syntax: + +ChDrive Text As String + + +Parameters: + Text: Any string expression that contains the drive letter of the new drive. If you want, you can use URL notation. +The drive must be assigned a capital letter. Under Windows, the letter that you assign the drive is restricted by the settings in LASTDRV. If the drive argument is a multiple-character string, only the first letter is relevant. If you attempt to access a non-existent drive, an error occurs that you can respond to with the OnError statement. + + + + + +Example: + +Sub ExampleChDrive + ChDrive "D" ' Only possible if a drive 'D' exists. +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020403.xhp b/helpcontent2/source/text/sbasic/shared/03020403.xhp new file mode 100644 index 000000000..c238a5d1e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020403.xhp @@ -0,0 +1,74 @@ + + + + + + + CurDir Function + /text/sbasic/shared/03020403.xhp + + + + + + +
+ + CurDir function + + + +CurDir Function +Returns a variant string that represents the current path of the specified drive. +
+ + +Syntax: + +CurDir [(Text As String)] + + +Return value: +String + +Parameters: + Text: Any string expression that specifies an existing drive (for example, "C" for the first partition of the first hard drive). +If no drive is specified or if the drive is a zero-length string (""), CurDir returns the path for the current drive. $[officename] Basic reports an error if the syntax of the drive description is incorrect, the drive does not exist, or if the drive letter occurs after the letter defined in the CONFIG.SYS with the Lastdrive statement. +This function is not case-sensitive. + + + + + + +Example: + +Sub ExampleCurDir +Dim sDir1 As String , sDir2 As String + sDir1 = "c:\Test" + sDir2 = "d:\Private" + ChDir( sDir1 ) + MsgBox CurDir + ChDir( sDir2 ) + MsgBox CurDir +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020404.xhp b/helpcontent2/source/text/sbasic/shared/03020404.xhp new file mode 100644 index 000000000..7a763a9f2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020404.xhp @@ -0,0 +1,85 @@ + + + + + + + Dir Function + /text/sbasic/shared/03020404.xhp + + + + + + +
+ + Dir function + + + +Dir Function +Returns the name of a file, a directory, or all of the files and the directories on a drive or in a directory that match the specified search path. +
+ +Syntax: + +Dir [(Text As String) [, Attrib As Integer]] + + +Return value: +String + +Parameters: + Text: Any string expression that specifies the search path, directory or file. This argument can only be specified the first time that you call the Dir function. If you want, you can enter the path in URL notation. + Attrib: Any integer expression that specifies bitwise file attributes. The Dir function only returns files or directories that match the specified attributes. You can combine several attributes by adding the attribute values: +0 : Normal files. +16 : Returns the name of the directory only. +Use this attribute to check if a file or directory exists, or to determine all files and folders in a specific directory. +To check if a file exists, enter the complete path and name of the file. If the file or directory name does not exist, the Dir function returns a zero-length string (""). +To generate a list of all existing files in a specific directory, proceed as follows: The first time you call the Dir function, specify the complete search path for the files, for example, "D:\Files\*.ods". If the path is correct and the search finds at least one file, the Dir function returns the name of the first file that matches the search path. To return additional file names that match the path, call Dir again, but with no arguments. +To return directories only, use the attribute parameter. The same applies if you want to determine the name of a volume (for example, a hard drive partition). + + + + +Example: + +Sub ExampleDir +' Displays all files and directories +Dim sPath As String +Dim sDir As String, sValue As String + sDir="Directories:" + sPath = CurDir + sValue = Dir$(sPath + getPathSeparator + "*",16) + Do + If sValue <> "." And sValue <> ".." Then + If (GetAttr( sPath + getPathSeparator + sValue) And 16) >0 Then + ' Get the directories + sDir = sDir & chr(13) & sValue + End If + End If + sValue = Dir$ + Loop Until sValue = "" + MsgBox sDir,0,sPath +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020405.xhp b/helpcontent2/source/text/sbasic/shared/03020405.xhp new file mode 100644 index 000000000..09b49a3fa --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020405.xhp @@ -0,0 +1,83 @@ + + + + + + + FileAttr Function + /text/sbasic/shared/03020405.xhp + + + + + + +
+ + FileAttr function + + + +FileAttr Function +Returns the access mode or the file access number of a file that was opened with the Open statement. The file access number is dependent on the operating system (OSH = Operating System Handle). +
+If you use a 32-Bit operating system, you cannot use the FileAttr-Function to determine the file access number. +See also: Open + +Syntax: + +FileAttr (FileNumber As Integer, Attribute As Integer) + + +Return value: +Integer + +Parameters: + FileNumber: The number of the file that was opened with the Open statement. + Attribute: Integer expression that indicates the type of file information that you want to return. The following values are possible: +1: The FileAttr-Function indicates the access mode of the file. +2: The FileAttr-Function returns the file access number of the operating system. +If you specify a parameter attribute with a value of 1, the following return values apply: +1 - INPUT (file open for input) +2 - OUTPUT (file open for output) +4 - RANDOM (file open for random access) +8 - APPEND (file open for appending) +32 - BINARY (file open in binary mode). + + + + +Example: + +Sub ExampleFileAttr +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + MsgBox FileAttr(#iNumber, 1 ),0,"Access mode" + MsgBox FileAttr(#iNumber, 2 ),0,"File attribute" + Close #iNumber +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020406.xhp b/helpcontent2/source/text/sbasic/shared/03020406.xhp new file mode 100644 index 000000000..3fb2923e8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020406.xhp @@ -0,0 +1,62 @@ + + + + + + + FileCopy Statement + /text/sbasic/shared/03020406.xhp + + + + + + +
+ + FileCopy statement + + + +FileCopy Statement +Copies a file. +
+ +Syntax: + +FileCopy TextFrom As String, TextTo As String + + +Parameters: + TextFrom: Any string expression that specifies the name of the file that you want to copy. The expression can contain optional path and drive information. If you want, you can enter a path in URL notation. + TextTo: Any string expression that specifies where you want to copy the source file to. The expression can contain the destination drive, the path, and file name, or the path in URL notation. +You can only use the FileCopy statement to copy files that are not opened. + + + + +Example: + +Sub ExampleFileCopy + FileCopy "c:\autoexec.bat", "c:\Temp\Autoexec.sav" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020407.xhp b/helpcontent2/source/text/sbasic/shared/03020407.xhp new file mode 100644 index 000000000..d198d3407 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020407.xhp @@ -0,0 +1,61 @@ + + + + + + + FileDateTime Function + /text/sbasic/shared/03020407.xhp + + + + + + +
+ + FileDateTime function + + + +FileDateTime Function +Returns a string that contains the date and the time that a file was created or last modified. +
+ +Syntax: + +FileDateTime (Text As String) + + +Parameters: + Text: Any string expression that contains an unambiguous (no wildcards) file specification. You can also use URL notation. +This function determines the exact time of creation or last modification of a file, returned in the format "MM.DD.YYYY HH.MM.SS". + + + + +Example: + +Sub ExampleFileDateTime + MsgBox FileDateTime("C:\autoexec.bat") +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020408.xhp b/helpcontent2/source/text/sbasic/shared/03020408.xhp new file mode 100644 index 000000000..8e443a6db --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020408.xhp @@ -0,0 +1,63 @@ + + + + + + + FileLen Function + /text/sbasic/shared/03020408.xhp + + + + + + +
+ + FileLen function + + + +FileLen Function +Returns the length of a file in bytes. +
+ +Syntax: + +FileLen (Text As String) + + +Return value: +Long + +Parameters: + Text: Any string expression that contains an unambiguous file specification. You can also use URL notation. +This function determines the length of a file. If the FileLen function is called for an open file, it returns the file length before it was opened. To determine the current file length of an open file, use the Lof function. + + + +Example: + +Sub ExampleFileLen + MsgBox FileLen("C:\autoexec.bat") +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020409.xhp b/helpcontent2/source/text/sbasic/shared/03020409.xhp new file mode 100644 index 000000000..cb1bee4d8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020409.xhp @@ -0,0 +1,169 @@ + + + + + + + GetAttr Function + /text/sbasic/shared/03020409.xhp + + + + + + +
+ + GetAttr function + + + +GetAttr Function +Returns a bit pattern that identifies the file type or the name of a volume or a directory. +
+ +Syntax: + +GetAttr (Text As String) + + +Return value: +Integer + +Parameters: + Text: Any string expression that contains an unambiguous file specification. You can also use URL notation. +This function determines the attributes for a specified file and returns the bit pattern that can help you to identify the following file attributes: + + + + +Value + + + + + Named constant + + + Value + + + Definition + + + + + ATTR_NORMAL + + + 0 + + + Normal files. + + + + + ATTR_READONLY + + + 1 + + + Read-only files. + + + + + ATTR_HIDDEN + + + 2 + + + Hidden file + + + + + ATTR_SYSTEM + + + 4 + + + System file + + + + + ATTR_VOLUME + + + 8 + + + Returns the name of the volume + + + + + ATTR_DIRECTORY + + + 16 + + + Returns the name of the directory only. + + + + + ATTR_ARCHIVE + + + 32 + + + File was changed since last backup (Archive bit). + + +
+ +If you want to know if a bit of the attribute byte is set, use the following query method: + +Example: + +Sub ExampleSetGetAttr +On Error GoTo ErrorHandler ' Define target for error handler + If Dir("C:\test",16)="" Then MkDir "C:\test" + If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" ,0 + FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" ,1 + Print GetAttr( "c:\test\autoexec.sav" ) + End +ErrorHandler: + Print Error + End +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020410.xhp b/helpcontent2/source/text/sbasic/shared/03020410.xhp new file mode 100644 index 000000000..bba94acb7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020410.xhp @@ -0,0 +1,60 @@ + + + + + + + Kill Statement + /text/sbasic/shared/03020410.xhp + + + + + + +
+ + Kill statement + + + +Kill Statement +Deletes a file from a disk. +
+ +Syntax: + +Kill File As String + + +Parameters: + File: Any string expression that contains an unambiguous file specification. You can also use URL notation. + + + + +Example: + +Sub ExampleKill + Kill "C:\datafile.dat" ' File must be created in advance +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020411.xhp b/helpcontent2/source/text/sbasic/shared/03020411.xhp new file mode 100644 index 000000000..a13781fa7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020411.xhp @@ -0,0 +1,101 @@ + + + + + + + MkDir Statement + /text/sbasic/shared/03020411.xhp + + + + + + +
+ + MkDir statement + + + +MkDir Statement +Creates a new directory on a data medium. +
+ +Syntax: + +MkDir Text As String + + +Parameters: + Text: Any string expression that specifies the name and path of the directory to be created. You can also use URL notation. +If the path is not determined, the directory is created in the current directory. + + + + +Example: + +Sub ExampleFileIO +' Example for functions of the file organization +Const sFile1 As String = "file://c|/autoexec.bat" +Const sDir1 As String = "file://c|/Temp" +Const sSubDir1 As String ="Test" +Const sFile2 As String = "Copied.tmp" +Const sFile3 As String = "Renamed.tmp" +Dim sFile As String + sFile = sDir1 + "/" + sSubDir1 + ChDir( sDir1 ) + If Dir(sSubDir1,16)="" Then ' Does the directory exist? + MkDir sSubDir1 + MsgBox sFile,0,"Create directory" + End If + sFile = sFile + "/" + sFile2 + FileCopy sFile1 , sFile + MsgBox fSysURL(CurDir()),0,"Current directory" + MsgBox sFile & Chr(13) & FileDateTime( sFile ),0,"Creation time" + MsgBox sFile & Chr(13)& FileLen( sFile ),0,"File length" + MsgBox sFile & Chr(13)& GetAttr( sFile ),0,"File attributes" + Name sFile As sDir1 + "/" + sSubDir1 + "/" + sFile3 + ' Rename in the same directory + sFile = sDir1 + "/" + sSubDir1 + "/" + sFile3 + SetAttr( sFile, 0 ) 'Delete all attributes + MsgBox sFile & Chr(13) & GetAttr( sFile ),0,"New file attributes" + Kill sFile + RmDir sDir1 + "/" + sSubDir1 +End Sub + +' Converts a system path in URL +Function fSysURL( fSysFp As String ) As String +Dim iPos As String + iPos = 1 + iPos = Instr(iPos,fSysFp, getPathSeparator()) + Do While iPos > 0 + Mid( fSysFp, iPos , 1,"/") + iPos = Instr(iPos+1,fSysFp, getPathSeparator()) + Loop + ' the colon with DOS + iPos = Instr(1,fSysFp,":") + If iPos > 0 Then Mid( fSysFp, iPos , 1,"|") + fSysURL = "file://" & fSysFp +End Function + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03020412.xhp b/helpcontent2/source/text/sbasic/shared/03020412.xhp new file mode 100644 index 000000000..a754376d6 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020412.xhp @@ -0,0 +1,65 @@ + + + + + + + Name Statement + /text/sbasic/shared/03020412.xhp + + + + + + +
+ + Name statement + + + +Name Statement +Renames an existing file or directory. +
+ +Syntax: + +Name OldName As String As NewName As String + + +Parameters: + OldName, NewName: Any string expression that specifies the file name, including the path. You can also use URL notation.see #i61074 + +Example: + +Sub ExampleReName +On Error GoTo Error +FileCopy "c:\autoexec.bat", "c:\temp\autoexec.sav" +Name "c:\temp\autoexec.sav" As "c:\temp\autoexec.bat" +End +Error: +If err = 58 Then + MsgBox "File already exists" +End If +End +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020413.xhp b/helpcontent2/source/text/sbasic/shared/03020413.xhp new file mode 100644 index 000000000..6ad7aed81 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020413.xhp @@ -0,0 +1,65 @@ + + + + + + + RmDir Statement + /text/sbasic/shared/03020413.xhp + + + + + + +
+ + RmDir statement + + + +RmDir Statement +Deletes an existing directory from a data medium. +
+ +Syntax: + +RmDir Text As String + + +Parameters: + Text: Any string expression that specifies the name and path of the directory that you want to delete. You can also use URL notation. +If the path is not determined, the RmDir Statement searches for the directory that you want to delete in the current path. If it is not found there, an error message appears. + + + + +Example: + +Sub ExampleRmDir + MkDir "C:\Test2" + ChDir "C:\test2" + MsgBox Curdir + ChDir "\" + RmDir "C:\test2" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020414.xhp b/helpcontent2/source/text/sbasic/shared/03020414.xhp new file mode 100644 index 000000000..e4cd4814d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020414.xhp @@ -0,0 +1,122 @@ + + + + + + + SetAttr Statement + /text/sbasic/shared/03020414.xhp + + + + + + +
+ + SetAttr statement + + + +SetAttr Statement +Sets the attribute information for a specified file. +
+ +Syntax: + +SetAttr FileName As String, Attribute As Integer + + +Parameters: +FileName: Name of the file, including the path, that you want to test attributes of. If you do not enter a path, SetAttr searches for the file in the current directory. You can also use URL notation. + Attribute: Bit pattern defining the attributes that you want to set or to clear: + Value + + + + + Named constant + + + Value + + + Definition + + + + + ATTR_NORMAL + + + 0 + + + Normal files. + + + + + ATTR_READONLY + + + 1 + + + Read-only files. + + + + + ATTR_HIDDEN + + + 2 + + + Hidden file + + +
+ +You can set multiple attributes by combining the respective values with a logic OR statement. + + + + + +Example: + +Sub ExampleSetGetAttr + On Error GoTo ErrorHandler ' Define target for error handler + If Dir("C:\test",16)="" Then MkDir "C:\test" + If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" ,0 + FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" , ATTR_READONLY + Print GetAttr( "c:\test\autoexec.sav" ) + End +ErrorHandler: + Print Error + End +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03020415.xhp b/helpcontent2/source/text/sbasic/shared/03020415.xhp new file mode 100644 index 000000000..162e1bf9b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020415.xhp @@ -0,0 +1,64 @@ + + + + + + + FileExists Function + /text/sbasic/shared/03020415.xhp + + + + + + +
+ + FileExists function + + + +FileExists Function +Determines if a file or a directory is available on the data medium. +
+ +Syntax: + +FileExists(FileName As String | DirectoryName As String) + + +Return value: +Bool + +Parameters: +FileName | DirectoryName: Any string expression that contains an unambiguous file specification. You can also use URL notation. + + + +Example: + +Sub ExampleFileExists + MsgBox FileExists("C:\autoexec.bat") + MsgBox FileExists("file:///d|/bookmark.htm") + MsgBox FileExists("file:///d|/Private") +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030000.xhp b/helpcontent2/source/text/sbasic/shared/03030000.xhp new file mode 100644 index 000000000..318f48925 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030000.xhp @@ -0,0 +1,44 @@ + + + + + + + +Date and Time Functions +/text/sbasic/shared/03030000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Date and Time Functions + Use the statements and functions described here to perform date and time calculations. +
+ %PRODUCTNAME Basic lets you calculate time or date differences by converting the time and date values to continuous numeric values. After the difference is calculated, special functions are used to reconvert the values to the standard time or date formats. + You can combine date and time values into a single floating-decimal number. Dates are converted to integers, and times to decimal values. %PRODUCTNAME Basic also supports the variable type Date, which can contain a time specification consisting of both a date and time. + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030100.xhp b/helpcontent2/source/text/sbasic/shared/03030100.xhp new file mode 100644 index 000000000..4ef4ed9e7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030100.xhp @@ -0,0 +1,53 @@ + + + + + + + + +Converting Date Values +/text/sbasic/shared/03030100.xhp + + +Sun Microsystems, Inc. + + + +
+Converting Date Values +The following functions convert date values to calculable numbers and back. +
+ + + + + + + + + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030101.xhp b/helpcontent2/source/text/sbasic/shared/03030101.xhp new file mode 100644 index 000000000..a313f6731 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030101.xhp @@ -0,0 +1,70 @@ + + + + + + + +DateSerial Function +/text/sbasic/shared/03030101.xhp + + +Sun Microsystems, Inc. + + + +
+DateSerial function + +DateSerial Function +Returns a Date value for a specified year, month, or day. +
+Syntax: + +DateSerial (year, month, day) + +Return value: +Date +Parameters: + +Year: Integer expression that indicates a year. All values between 0 and 99 are interpreted as the years 1900-1999. For years that fall outside this range, you must enter all four digits. + +Month: Integer expression that indicates the month of the specified year. The accepted range is from 1-12. + +Day: Integer expression that indicates the day of the specified month. The accepted range is from 1-31. No error is returned when you enter a non-existing day for a month shorter than 31 days.see i69463 +The DateSerial function returns the number of days between December 30,1899 and the given date. You can use this function to calculate the difference between two dates. +The DateSerial function returns the data type Variant with VarType 7 (Date). Internally, this value is stored as a Double value, so that when the given date is 1.1.1900, the returned value is 2. Negative values correspond to dates before December 30, 1899 (not inclusive). +If a date is defined that lies outside of the accepted range, $[officename] Basic returns an error message. +Whereas you define the DateValue function as a string that contains the date, the DateSerial function evaluates each of the parameters (year, month, day) as separate numeric expressions. + + +Example: + +Sub ExampleDateSerial +Dim lDate As Long +Dim sDate As String + lDate = DateSerial(1964, 4, 9) + sDate = DateSerial(1964, 4, 9) + MsgBox lDate ' returns 23476 + MsgBox sDate ' returns 04/09/1964 +End Sub + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03030102.xhp b/helpcontent2/source/text/sbasic/shared/03030102.xhp new file mode 100644 index 000000000..b8332eba1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030102.xhp @@ -0,0 +1,57 @@ + + + + + + + +DateValue Function +/text/sbasic/shared/03030102.xhp + + +Sun Microsystems, Inc. + + + +
+DateValue function + +DateValue Function +Returns a date value from a date string. The date string is a complete date in a single numeric value. You can also use this serial number to determine the difference between two dates. +
+Syntax: + +DateValue [(date)] + +Return value: +Datei66764 +Parameters: + + Date: String expression that contains the date that you want to calculate. In contrast to the DateSerial function that passes years, months and days as separate numeric values, the DateValue function requests the date string to be according to either one of the date acceptance patterns defined for your locale setting (see %PRODUCTNAME - PreferencesTools - Options - Language Settings - Languages) or to ISO date format (momentarily, only the ISO format with hyphens, e.g. "2012-12-31" is accepted). + + +Example: + +Sub ExampleDateValue + MsgBox DateValue("12/02/2011") +End Sub + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03030103.xhp b/helpcontent2/source/text/sbasic/shared/03030103.xhp new file mode 100644 index 000000000..b39292b03 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030103.xhp @@ -0,0 +1,62 @@ + + + + + + + +Day Function +/text/sbasic/shared/03030103.xhp + + +Sun Microsystems, Inc. + + + +
+Day function + +Day Function +Returns a value that represents the day of the month based on a serial date number generated by DateSerial or DateValue. +
+Syntax: + +Day (Number) + +Return value: +Integer +Parameters: + +Number: A numeric expression that contains a serial date number from which you can determine the day of the month. +This function is basically the opposite of the DateSerial function, returning the day of the month from a serial date number generated by the DateSerial or the DateValue function. For example, the expression + +Print Day (DateSerial(1994, 12, 20)) + +returns the value 20. + + +Example: + +Sub ExampleDay + Print "Day " & Day(DateSerial(1994, 12, 20)) & " of the month" +End Sub + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03030104.xhp b/helpcontent2/source/text/sbasic/shared/03030104.xhp new file mode 100644 index 000000000..90e7d4754 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030104.xhp @@ -0,0 +1,62 @@ + + + + + + + +Month Function +/text/sbasic/shared/03030104.xhp + + +Sun Microsystems, Inc. + + + +
+Month function + +Month Function +Returns the month of a year from a serial date that is generated by the DateSerial or the DateValue function. +
+Syntax: + +Month (Number) + +Return value: +Integer +Parameters: + +Number: Numeric expression that contains the serial date number that is used to determine the month of the year. +This function is the opposite of the DateSerial function. It returns the month in the year that corresponds to the serial date that is generated by DateSerial or DateValue. For example, the expression + +Print Month(DateSerial(1994, 12, 20)) + +returns the value 12. + + +Example: + +Sub ExampleMonth + MsgBox "" & Month(Now) ,64,"The current month" +End Sub + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03030105.xhp b/helpcontent2/source/text/sbasic/shared/03030105.xhp new file mode 100644 index 000000000..874ee751a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030105.xhp @@ -0,0 +1,73 @@ + + + + + +WeekDay Function +/text/sbasic/shared/03030105.xhp + + +Sun Microsystems, Inc. + + + +
+WeekDay function + +

WeekDay Function (BASIC)

+Returns the number corresponding to the weekday represented by a serial date number that is generated by the DateSerial or the DateValue function. +
+ + +WeekDay (Number) + + +Integer + + +Number: Integer expression that contains the serial date number that is used to calculate the day of the week (1-7). +The following example determines the day of the week using the WeekDay function when you enter a date. + + + + +Sub ExampleWeekDay +Dim sDay As String +' Return And display the day of the week + Select Case WeekDay( Now ) + Case 1 + sDay="Sunday" + Case 2 + sDay="Monday" + Case 3 + sDay="Tuesday" + Case 4 + sDay="Wednesday" + Case 5 + sDay="Thursday" + Case 6 + sDay="Friday" + Case 7 + sDay="Saturday" + End Select + MsgBox "" + sDay,64,"Today Is" +End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030106.xhp b/helpcontent2/source/text/sbasic/shared/03030106.xhp new file mode 100644 index 000000000..6d99a611a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030106.xhp @@ -0,0 +1,62 @@ + + + + + + + +Year Function +/text/sbasic/shared/03030106.xhp + + +Sun Microsystems, Inc. + + + +
+Year function + +Year Function +Returns the year from a serial date number that is generated by the DateSerial or the DateValue function. +
+Syntax: + +Year (Number) + +Return value: +Integer +Parameters: + +Number: Integer expression that contains the serial date number that is used to calculate the year. +This function is the opposite of the DateSerial function, and returns the year of a serial date. For example, the expression: + +Print Year(DateSerial(1994, 12, 20)) + +returns the value 1994. + + +Example: + +Sub ExampleYear + MsgBox "" & Year(Now) ,64,"Current year" +End Sub + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03030107.xhp b/helpcontent2/source/text/sbasic/shared/03030107.xhp new file mode 100644 index 000000000..947b738f9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030107.xhp @@ -0,0 +1,62 @@ + + + + + + + CDateToIso Function + /text/sbasic/shared/03030107.xhp + + + + + +
+ + CdateToIso function + + +CDateToIso Function +Returns the date in ISO format without separators (YYYYMMDD) from a serial date number that is generated by the DateSerial or the DateValue or the CDateFromIso function. +The year part consists of at least four digits, with leading zeros if the absolute value is less than 1000, it can be negative with a leading minus sign if the date passed denotes a year before the common era (BCE) and it can have more than four digits if the absolute value is greater than 9999. The formatted string returned can be in the range "-327680101" to "327671231". +Years less than 100 and greater than 9999 are supported since %PRODUCTNAME 5.4. +
+ +Syntax: + +CDateToIso(Number) + + +Return value: +String + +Parameters: + Number: Integer that contains the serial date number. + + + +Example: + +Sub ExampleCDateToIso + MsgBox "" & CDateToIso(Now) ,64,"ISO Date" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030108.xhp b/helpcontent2/source/text/sbasic/shared/03030108.xhp new file mode 100644 index 000000000..1662472af --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030108.xhp @@ -0,0 +1,60 @@ + + + + + + + +CDateFromIso Function +/text/sbasic/shared/03030108.xhp + + +Sun Microsystems, Inc. + + + +
+CdateFromIso function + +CDateFromIso Function +Returns the internal date number from a string that contains a date in ISO format (YYYYMMDD or YYYY-MM-DD). +The year part must consist of either two (supported only in YYMMDD format without separators for compatibility) or at least four digits. With four digits leading zeros must be given if the absolute value is less than 1000, it can be negative with a leading minus sign if the date passed denotes a year before the common era (BCE) and it can have more than four digits if the absolute value is greater than 9999. The formatted string can be in the range "-327680101" to "327671231", or "-32768-01-01" to "32767-12-31". +An invalid date results in an error. Year 0 is not accepted, the last day BCE is -0001-12-31 and the next day CE is 0001-01-01. Dates before 1582-10-15 are in the proleptic Gregorian calendar. +When converting a date serial number to a printable string, for example for the Print or MsgBox command, the locale's default calendar is used and at that 1582-10-15 cutover date may switch to the Julian calendar, which can result in a different date being displayed than expected. Use the CDateToIso Function to convert such date number to a string representation in the proleptic Gregorian calendar. +The YYYY-MM-DD format with separators is supported since %PRODUCTNAME 5.3.4. Years less than 100 or greater than 9999 are accepted since %PRODUCTNAME 5.4 if not in VBA compatibility mode. +
+Syntax: + +CDateFromIso(String) + +Return value: +Internal date number +Parameters: + +String: A string that contains a date in ISO format. + + +Example: + + dateval = CDateFromIso("20021231") + dateval = CDateFromIso("2002-12-31") + +return both 12/31/2002 in the date format of your system + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030110.xhp b/helpcontent2/source/text/sbasic/shared/03030110.xhp new file mode 100644 index 000000000..9fb32487b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030110.xhp @@ -0,0 +1,157 @@ + + + + + + + DateAdd Function + /text/sbasic/shared/03030110.xhp + + + + + + +
+ + DateAdd function + + + +DateAdd Function +Adds a date interval to a given date a number of times and returns the resulting date. +
+ +Syntax: + +DateAdd (Add, Count, Date) + + +Return value: +A Variant containing a date. + +Parameters: + Add - A string expression from the following table, specifying the date interval. + +
+ + + + + Add (string value) + + + Explanation + + + + + yyyy + + + Year + + + + + q + + + Quarter + + + + + m + + + Month + + + + + y + + + Day of year + + + + + w + + + Weekday + + + + + ww + + + Week of year + + + + + d + + + Day + + + + + h + + + Hour + + + + + n + + + Minute + + + + + s + + + Second + + +
+ +
+Count - A numerical expression specifying how often the Add interval will be added (Count is positive) or subtracted (Count is negative). +Date - A given date or the name of a Variant variable containing a date. The Add value will be added Count times to this value. + +Example: + +Sub example_dateadd + MsgBox DateAdd("m", 1, "1/31/2004") &" - "& DateAdd("m", 1, "1/31/2005") +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030111.xhp b/helpcontent2/source/text/sbasic/shared/03030111.xhp new file mode 100644 index 000000000..748dfe0ed --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030111.xhp @@ -0,0 +1,63 @@ + + + + + + + CDateToUnoDate Function + /text/sbasic/shared/03030111.xhp + + + + + + +
+ + CDateToUnoDate function + + + +CDateToUnoDate Function +Returns the date as a UNO com.sun.star.util.Date struct. +
+ +Syntax: + +CDateToUnoDate(aDate) + + +Return value: +com.sun.star.util.Date + +Parameters: + aDate: Date to convert + + + +Example: + +Sub ExampleCDateToUnoDate + aDatabaseRow.updateDate(3, CDateToUnoDate(Now)) + aDateControl.Date = CDateToUnoDate(Now) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030112.xhp b/helpcontent2/source/text/sbasic/shared/03030112.xhp new file mode 100644 index 000000000..1cce523c5 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030112.xhp @@ -0,0 +1,63 @@ + + + + + + + CDateFromUnoDate Function + /text/sbasic/shared/03030112.xhp + + + + + + +
+ + CDateFromUnoDate function + + + +CDateFromUnoDate Function +Converts a UNO com.sun.star.util.Date struct to a Date value. +
+ +Syntax: + +CDateFromUnoDate(aDate) + + +Return value: +Date + +Parameters: + aDate: Date to convert + + + +Example: + +Sub ExampleCDateFromUnoDate + MsgBox(CDateFromUnoDate(aDatabaseRow.getDate(3))) + MsgBox(CDateFromUnoDate(aDateControl.Date)) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030113.xhp b/helpcontent2/source/text/sbasic/shared/03030113.xhp new file mode 100644 index 000000000..1a19ab689 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030113.xhp @@ -0,0 +1,63 @@ + + + + + + + CDateToUnoTime Function + /text/sbasic/shared/03030113.xhp + + + + + + +
+ + CDateToUnoTime function + + + +CDateToUnoTime Function +Returns the time part of the date as a UNO com.sun.star.util.Time struct. +
+ +Syntax: + +CDateToUnoTime(aDate) + + +Return value: +com.sun.star.util.Time + +Parameters: + aDate: Date value to convert + + + +Example: + +Sub ExampleCDateToUnoTime + aDatabaseRow.updateTime(3, CDateToUnoTime(Now)) + aTimeControl.Time = CDateToUnoTime(Now) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030114.xhp b/helpcontent2/source/text/sbasic/shared/03030114.xhp new file mode 100644 index 000000000..2c37d6778 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030114.xhp @@ -0,0 +1,63 @@ + + + + + + + CDateFromUnoTime Function + /text/sbasic/shared/03030114.xhp + + + + + + +
+ + CDateFromUnoTime function + + + +CDateFromUnoTime Function +Converts a UNO com.sun.star.util.Time struct to a Date value. +
+ +Syntax: + +CDateFromUnoTime(aTime) + + +Return value: +Date + +Parameters: + aTime: Time to convert + + + +Example: + +Sub ExampleCDateFromUnoTime + MsgBox(CDateFromUnoTime(aDatabaseRow.getTime(3))) + MsgBox(CDateFromUnoTime(aTimeControl.Time)) +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030115.xhp b/helpcontent2/source/text/sbasic/shared/03030115.xhp new file mode 100644 index 000000000..7523d3264 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030115.xhp @@ -0,0 +1,62 @@ + + + + + + + CDateToUnoDateTime Function + /text/sbasic/shared/03030115.xhp + + + + + + +
+ + CDateToUnoDateTime function + + + +CDateToUnoDateTime Function +Returns the time part of the date as a UNO com.sun.star.util.DateTime struct. +
+ +Syntax: + +CDateToUnoDateTime(aDate) + + +Return value: +com.sun.star.util.DateTime + +Parameters: + aDate: Date value to convert + + + +Example: + +Sub ExampleCDateToUnoDateTime + aDatabaseRow.updateTimestamp(3, CDateToUnoDateTime(Now)) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030116.xhp b/helpcontent2/source/text/sbasic/shared/03030116.xhp new file mode 100644 index 000000000..f46887f53 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030116.xhp @@ -0,0 +1,62 @@ + + + + + + + CDateFromUnoDateTime Function + /text/sbasic/shared/03030116.xhp + + + + + + +
+ + CDateFromUnoDateTime function + + + +CDateFromUnoDateTime Function +Converts a UNO com.sun.star.util.DateTime struct to a Date value. +
+ +Syntax: + +CDateFromUnoDateTime(aDateTime) + + +Return value: +Date + +Parameters: + aDateTime: DateTime to convert + + + +Example: + +Sub ExampleCDateFromUnoDateTime + MsgBox(CDateFromUnoDateTime(aDatabaseRow.getTimestamp(3))) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030120.xhp b/helpcontent2/source/text/sbasic/shared/03030120.xhp new file mode 100644 index 000000000..fdcbbcc61 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030120.xhp @@ -0,0 +1,187 @@ + + + + + + + DateDiff Function + /text/sbasic/shared/03030120.xhp + + + + + + +
+ + DateDiff function + + + +DateDiff Function +Returns the number of date intervals between two given date values. +
+ +Syntax: + +DateDiff (Add, Date1, Date2 [, Week_start [, Year_start]]) + + +Return value: +A number. + +Parameters: + Add - A string expression from the following table, specifying the date interval. + + Date1, Date2 - The two date values to be compared. + +
+ Week_start - An optional parameter that specifies the starting day of a week. + + + + + Week_start value + + + Explanation + + + + + 0 + + + Use system default value + + + + + 1 + + + Sunday (default) + + + + + 2 + + + Monday + + + + + 3 + + + Tuesday + + + + + 4 + + + Wednesday + + + + + 5 + + + Thursday + + + + + 6 + + + Friday + + + + + 7 + + + Saturday + + +
+ + Year_start - An optional parameter that specifies the starting week of a year. + + + + + Year_start value + + + Explanation + + + + + 0 + + + Use system default value + + + + + 1 + + + Week 1 is the week with January, 1st (default) + + + + + 2 + + + Week 1 is the first week containing four or more days of that year + + + + + 3 + + + Week 1 is the first week containing only days of the new year + + +
+ +
+ +Example: + +Sub example_datediff + MsgBox DateDiff("d", "1/1/2005", "12/31/2005") +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030130.xhp b/helpcontent2/source/text/sbasic/shared/03030130.xhp new file mode 100644 index 000000000..69beffd4b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030130.xhp @@ -0,0 +1,63 @@ + + + + + + + DatePart Function + /text/sbasic/shared/03030130.xhp + + + + + + +
+ + DatePart function + + + +DatePart Function +The DatePart function returns a specified part of a date. +
+ +Syntax: + +DatePart (Add, Date [, Week_start [, Year_start]]) + + +Return value: +A Variant containing a date. + +Parameters: + Add - A string expression from the following table, specifying the date interval. + + Date - The date from which the result is calculated. + + +Example: + +Sub example_datepart + MsgBox DatePart("ww", "12/31/2005") +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030200.xhp b/helpcontent2/source/text/sbasic/shared/03030200.xhp new file mode 100644 index 000000000..4bdce6292 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030200.xhp @@ -0,0 +1,49 @@ + + + + + + + + +Converting Time Values +/text/sbasic/shared/03030200.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Converting Time Values + The following functions convert time values to calculable numbers. +
+ + + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030201.xhp b/helpcontent2/source/text/sbasic/shared/03030201.xhp new file mode 100644 index 000000000..ebda5e11c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030201.xhp @@ -0,0 +1,56 @@ + + + + + + + + Hour Function + /text/sbasic/shared/03030201.xhp + + + +
+Hour function + +Hour Function + Returns the hour from a time value that is generated by the TimeSerial or the TimeValue function. +
+ Syntax: + +Hour (Number) + + Return value: + Integer + Parameters: + + Number: Numeric expression that contains the serial time value that is used to return the hour value. + This function is the opposite of the TimeSerial function. It returns an integer value that represents the hour from a time value that is generated by the TimeSerial or the TimeValue function. For example, the expression + Print Hour(TimeSerial(12,30,41)) + returns the value 12. + + + Example: + + Sub ExampleHour + Print "The current hour is " & Hour( Now ) + End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030202.xhp b/helpcontent2/source/text/sbasic/shared/03030202.xhp new file mode 100644 index 000000000..d4ab9d51f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030202.xhp @@ -0,0 +1,56 @@ + + + + + + + + Minute Function + /text/sbasic/shared/03030202.xhp + + + +
+Minute function + +Minute Function + Returns the minute of the hour that corresponds to the serial time value that is generated by the TimeSerial or the TimeValue function. +
+ Syntax: + +Minute (Number) + + Return value: + Integer + Parameters: + + Number: Numeric expression that contains the serial time value that is used to return the minute value. + This function is the opposite of the TimeSerial function. It returns the minute of the serial time value that is generated by the TimeSerial or the TimeValue function. For example, the expression: + Print Minute(TimeSerial(12,30,41)) + returns the value 30. + + + Example: + + Sub ExampleMinute + MsgBox "The current minute is "& Minute(Now)& "." + End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030203.xhp b/helpcontent2/source/text/sbasic/shared/03030203.xhp new file mode 100644 index 000000000..938032c74 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030203.xhp @@ -0,0 +1,56 @@ + + + + + + + Now Function + /text/sbasic/shared/03030203.xhp + + + + + +
+ + Now function + + +Now Function +Returns the current system date and time as a Date value. +
+ +Syntax: + +Now + + +Return value: +Date + +Example: + +Sub ExampleNow + MsgBox "It is now " & Now +End Sub + + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03030204.xhp b/helpcontent2/source/text/sbasic/shared/03030204.xhp new file mode 100644 index 000000000..77d6bf906 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030204.xhp @@ -0,0 +1,65 @@ + + + + + + + Second Function + /text/sbasic/shared/03030204.xhp + + + + + + +
+ + Second function + + + +Second Function +Returns an integer that represents the seconds of the serial time number that is generated by the TimeSerial or the TimeValue function. +
+ +Syntax: + +Second (Number) + + +Return value: +Integer + +Parameters: + Number: Numeric expression that contains the serial time number that is used to calculate the number of seconds. +This function is the opposite of the TimeSerial function. It returns the seconds of a serial time value that is generated by the TimeSerial or TimeValue functions. For example, the expression: +Print Second(TimeSerial(12,30,41)) +returns the value 41. + + + +Example: + +Sub ExampleSecond + MsgBox "The exact second of the current time is "& Second( Now ) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030205.xhp b/helpcontent2/source/text/sbasic/shared/03030205.xhp new file mode 100644 index 000000000..c351bf9fd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030205.xhp @@ -0,0 +1,76 @@ + + + + + + + TimeSerial Function + /text/sbasic/shared/03030205.xhp + + + + + + +
+ + TimeSerial function + + + +TimeSerial Function +Calculates a serial time value for the specified hour, minute, and second parameters that are passed as numeric value. You can then use this value to calculate the difference between times. +
+ +Syntax: + +TimeSerial (hour, minute, second) + + +Return value: +Date + +Parameters: + hour: Any integer expression that indicates the hour of the time that is used to determine the serial time value. Valid values: 0-23. + minute: Any integer expression that indicates the minute of the time that is used to determine the serial time value. In general, use values between 0 and 59. However, you can also use values that lie outside of this range, where the number of minutes influence the hour value. + second: Any integer expression that indicates the second of the time that is used to determine the serial time value. In general, you can use values between 0 and 59. However, you can also use values that lie outside of this range, where the number seconds influences the minute value. + Examples: +12, -5, 45 corresponds to 11, 55, 45 +12, 61, 45 corresponds to 13, 2, 45 +12, 20, -2 corresponds to 12, 19, 58 +12, 20, 63 corresponds to 12, 21, 4 +You can use the TimeSerial function to convert any time into a single value that you can use to calculate time differences. +The TimeSerial function returns the type Variant with VarType 7 (Date). This value is stored internally as a double-precision number between 0 and 0.9999999999. As opposed to the DateSerial or DateValue function, where the serial date values are calculated as days relative to a fixed date, you can calculate with values returned by the TimeSerial function, but you cannot evaluate them. +In the TimeValue function, you can pass a string as a parameter containing the time. For the TimeSerial function, however, you can pass the individual parameters (hour, minute, second) as separate numeric expressions. + + + +Example: + +Sub ExampleTimeSerial +Dim dDate As Double, sDate As String + dDate = TimeSerial(8,30,15) + sDate = TimeSerial(8,30,15) + MsgBox dDate,64,"Time as a number" + MsgBox sDate,64,"Formatted time" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030206.xhp b/helpcontent2/source/text/sbasic/shared/03030206.xhp new file mode 100644 index 000000000..baf4ee9ea --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030206.xhp @@ -0,0 +1,78 @@ + + + + + + + TimeValue Function + /text/sbasic/shared/03030206.xhp + + + + + + +
+ + TimeValue function + + + +TimeValue Function +Calculates a serial time value from the specified hour, minute, and second - parameters passed as strings - that represents the time in a single numeric value. This value can be used to calculate the difference between times. +
+ +Syntax: + +TimeValue (Text As String) + + +Return value: +Date + +Parameters: + Text: Any string expression that contains the time that you want to calculate in the format "HH:MM:SS". +Use the TimeValue function to convert any time into a single value, so that you can calculate time differences. +This TimeValue function returns the type Variant with VarType 7 (Date), and stores this value internally as a double-precision number between 0 and 0.9999999999. +As opposed to the DateSerial or the DateValue function, where serial date values result in days relative to a fixed date, you can calculate with the values that are returned by the TimeValue function, but you cannot evaluate them. +In the TimeSerial function, you can pass individual parameters (hour, minute, second) as separate numeric expressions. For the TimeValue function, however, you can pass a string as a parameter containing the time. + + + + +Example: + +Sub ExampleTimerValue +Dim daDT As Date +Dim a1, b1, c1, a2, b2, c2 As String + a1 = "start time" + b1 = "end time" + c1 = "total time" + a2 = "8:34" + b2 = "18:12" + daDT = TimeValue(b2) - TimeValue(a2) + c2 = a1 & ": " & a2 & chr(13) + c2 = c2 & b1 & ": " & b2 & chr(13) + c2 = c2 & c1 & ": " & trim(Str(Hour(daDT))) & ":" & trim(Str(Minute(daDT))) & ":" & trim(Str(Second(daDT))) + MsgBox c2 +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030300.xhp b/helpcontent2/source/text/sbasic/shared/03030300.xhp new file mode 100644 index 000000000..6c79c4ea2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030300.xhp @@ -0,0 +1,44 @@ + + + + + + + + +System Date and Time +/text/sbasic/shared/03030300.xhp + + +Sun Microsystems, Inc. + + + + + +
+ System Date and Time + The following functions and statements set or return the system date and time. +
+ + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03030301.xhp b/helpcontent2/source/text/sbasic/shared/03030301.xhp new file mode 100644 index 000000000..240e94954 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030301.xhp @@ -0,0 +1,57 @@ + + + + + + + Date Statement + /text/sbasic/shared/03030301.xhp + + + + + + +
+ + Date statement + + + +Date Statement +Returns the current system date as a string, or resets the date. The date format depends on your local system settings. +
+ +Syntax: + +Date ; Date = Text As String + + +Parameters: + Text: Only required in order to reset the system date. In this case, the string expression must correspond to the date format defined in your local settings. + +Example: + +Sub ExampleDate + MsgBox "The date is " & Date +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03030302.xhp b/helpcontent2/source/text/sbasic/shared/03030302.xhp new file mode 100644 index 000000000..eb45700fa --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030302.xhp @@ -0,0 +1,56 @@ + + + + + + + Time Statement + /text/sbasic/shared/03030302.xhp + + + + + +
+ + Time statement + + +Time Statement +This function returns the current system time as a string in the format "HH:MM:SS". +
+ +Syntax: + +Time + + +Parameters: + Text: Any string expression that specifies the new time in the format "HH:MM:SS". + +Example: + +Sub ExampleTime + MsgBox Time,0,"The time is" +End Sub + + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03030303.xhp b/helpcontent2/source/text/sbasic/shared/03030303.xhp new file mode 100644 index 000000000..08cefe05b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030303.xhp @@ -0,0 +1,63 @@ + + + + + + + Timer Function + /text/sbasic/shared/03030303.xhp + + + + + +
+ + Timer function + + +Timer Function +Returns a value that specifies the number of seconds that have elapsed since midnight. +
+You must first declare a variable to call the Timer function and assign it the "Long " data type, otherwise a Date value is returned. + +Syntax: + +Timer + + +Return value: +Date + +Example: + +Sub ExampleTimer +Dim lSec As Long,lMin As Long,lHour As Long + lSec = Timer + MsgBox lSec,0,"Seconds since midnight" + lMin = lSec / 60 + lSec = lSec Mod 60 + lHour = lMin / 60 + lMin = lMin Mod 60 + MsgBox Right("00" & lHour , 2) & ":"& Right("00" & lMin , 2) & ":" & Right("00" & lSec , 2) ,0,"The time is" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03040000.xhp b/helpcontent2/source/text/sbasic/shared/03040000.xhp new file mode 100644 index 000000000..0bcdb47e9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03040000.xhp @@ -0,0 +1,356 @@ + + + + + + + Basic Constants + /text/sbasic/shared/03040000.xhp + + + + +
+ +Basic constants + + Basic Constants + Constants used in Basic programs +
+ +
+ +Boolean Basic constants +Basic constant;False +Basic constant;True + +

Boolean constants

+ + + + + Name + + + Type + + + Value + + + + + True + + + Boolean + + + 1 + + + + + False + + + Boolean + + + 0 + + +
+ + + + Dim bPositive as Boolean + bPositive = True + +
+ +
+ +Basic Mathematical constants +Pi;Basic constant +Basic constant;Pi + + +

Mathematical constant

+ + + + + Name + + + Type + + + Value + + + + + Pi + + + Double + + + 3.14159265358979 + + +
+ + + + Function Rad2Deg( aRad as Double) As Double + Rad2Deg = aRad * 180.00 / Pi + End Function + +
+ +
+ +Basic Object constants +Empty;Basic constant +Null;Basic constant +Nothing;Basic constant +Basic constant;Nothing +Basic constant;Null +Basic constant;Empty + + +

Object Constants

+ + + + + Name + + + Type + + + Usage + + + + + Empty + + + Variant + + + The Empty value indicates that the variable is not initialized. + + + + + Null + + + null + + + Indicates that the variable does not contain data. + + + + + Nothing + + + Object + + + Assign the Nothing object to a variable to remove a previous assignment. + + +
+ + + + SubExampleEmpty + Dim sVar As Variant + sVar = Empty + Print IsEmpty(sVar) ' Returns True + End Sub + Sub ExampleNull + Dim vVar As Variant + MsgBox IsNull(vVar) + End Sub + Sub ExampleNothing + Dim oDoc As Object + Set oDoc = ThisComponent + Print oDoc.Title + oDoc = Nothing + Print oDoc ‘ Error + End Sub + +
+
+ +Visual Basic constants +VBA Exclusive constants + +

Additional VBA constants

+ The following constants are available when VBA compatibility mode is enabled + + + + + + Named constant + + + Hexadecimal (decimal) value + + + Description + + + + + vbTrue + + + -1 + + + Part of vbTriState enumeration. + + + + + vbFalse + + + 0 + + + Part of vbTriState enumeration. + + + + + vbUseDefault + + + -2 + + + Part of vbTriState enumeration. + + + + + vbCr + + + \x0D (13) + + + CR - Carriage return + + + + + vbCrLf + + + \x0D\x0A (13 10) + + + CRLF - Carriage return and line feed + + + + + vbFormFeed + + + \x0c (12) + + + FF - Form feed + + + + + vbLf + + + \x0A (10) + + + LF - Line feed + + + + + vbNewLine + + + \x0D\x0A (13 10) for Windows + \x0A (10) for other systems + + + LF or CRLF + + + + + vbNullString + + + "" + + + Null string + + + + + vbTab + + + \x09 (9) + + + HT - Horizontal tab + + + + + vbVerticalTab + + + \x0B (11) + + + VT - Vertical tab + + +
+
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03050000.xhp b/helpcontent2/source/text/sbasic/shared/03050000.xhp new file mode 100644 index 000000000..3c72c3ebf --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03050000.xhp @@ -0,0 +1,44 @@ + + + + + + Error-Handling Functions + /text/sbasic/shared/03050000.xhp + + + Sun Microsystems, Inc. + + + +
+

Error-Handling Functions

+ Use the following statements and functions to define the way %PRODUCTNAME Basic reacts to run-time errors. +
+ %PRODUCTNAME Basic offers several methods to prevent the termination of a program when a run-time error occurs. + + + + + + + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03050100.xhp b/helpcontent2/source/text/sbasic/shared/03050100.xhp new file mode 100644 index 000000000..e10ff2d81 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03050100.xhp @@ -0,0 +1,70 @@ + + + + + + + Erl Function + /text/sbasic/shared/03050100.xhp + + + + + +
+ + Erl function + + +Erl Function +Returns the line number where an error occurred during program execution. +
+ +Syntax: + +Erl + + +Return value: +Integer + +Parameters: +The Erl function only returns a line number, and not a line label. + +Example: + +Sub ExampleError +On Error GoTo ErrorHandler ' Set up error handler +Dim iVar As Integer +Dim sVar As String +' Error caused by non-existent file + iVar = Freefile + Open "\file9879.txt" For Input As #iVar + Line Input #iVar, sVar + Close #iVar + Exit Sub +ErrorHandler: + MsgBox "Error " & err & ": " & Error$ + chr(13) + "In Line : " + Erl + chr(13) + Now , 16 ,"An error occurred" +End Sub + +
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03050200.xhp b/helpcontent2/source/text/sbasic/shared/03050200.xhp new file mode 100644 index 000000000..a6ee49f82 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03050200.xhp @@ -0,0 +1,66 @@ + + + + + + + +Err Function +/text/sbasic/shared/03050200.xhp + + +Sun Microsystems, Inc. + + + +
+Err function + +Err Function +Returns an error code that identifies the error that occurred during program execution. +
+Syntax: + +Err + +Return value: +Integer +Parameters: +The Err function is used in error-handling routines to determine the error and the corrective action. +Example: + +Sub ExampleError +On Error Goto ErrorHandler REM Set up error handler +Dim iVar as Integer +Dim sVar As String +REM Error occurs due to non-existent file + iVar = Freefile + Open "\file9879.txt" for Input as #iVar + Line Input #iVar, sVar + Close #iVar +Exit Sub +ErrorHandler: + MsgBox "Error " & Err & ": " & Error$ + chr(13) + "At line : " + Erl + chr(13) + Now , 16 ,"an error occurred" +End Sub + +
+ +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03050300.xhp b/helpcontent2/source/text/sbasic/shared/03050300.xhp new file mode 100644 index 000000000..f3964172a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03050300.xhp @@ -0,0 +1,55 @@ + + + + + +Error Function +/text/sbasic/shared/03050300.xhp + + +Sun Microsystems, Inc. + + + +
+Error function + +Error Function +Returns the error message that corresponds to a value or raises a given error context. +
+Syntax: + +Error +Error(expression) +Error err_code + +Return value: +String or raised error context +Parameters: +If no argument is provided, the Error function returns the error message of the most recent error that occurred during program execution. + +expression: Any numeric expression whose error code can be mapped to an existing error message. An empty string is returned if the error code does not exist. +err_code: Any value that corresponds to an existing error code. + +fixed i60953 +
+ +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03050500.xhp b/helpcontent2/source/text/sbasic/shared/03050500.xhp new file mode 100644 index 000000000..2481ea1cf --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03050500.xhp @@ -0,0 +1,89 @@ + + + + + + + On Error GoTo ... Resume Statement + /text/sbasic/shared/03050500.xhp + + + + + + +
+ + Resume Next parameter + On Error GoTo ... Resume statement + + + +On Error GoTo ... Resume Statement +Enables an error-handling routine after an error occurs, or resumes program execution. +
+ +Syntax: + + On Error Statement diagram + + +On {[Local] Error GoTo Labelname | GoTo 0 | Resume Next} + + +Parameters: +GoTo Labelname: If an error occurs, enables the error-handling routine that starts at the line "Labelname". +Resume Next: If an error occurs, program execution continues with the statement that follows the statement in which the error occurred. +GoTo 0: Disables the error handler in the current procedure. +Local: "On error" is global in scope, and remains active until canceled by another "On error" statement. "On Local error" is local to the routine which invokes it. Local error handling overrides any previous global setting. When the invoking routine exits, the local error handling is canceled automatically, and any previous global setting is restored. +The On Error GoTo statement is used to react to errors that occur in a macro.see i112231: The statement must be inserted at the start of a procedure (in a local error-handling routine) or at the start of a module. + +Example: + +Sub ExampleReset +On Error GoTo ErrorHandler +Dim iNumber As Integer +Dim iCount As Integer +Dim sLine As String +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + For iCount = 1 To 5 + Line Input #iNumber, sLine + If sLine <>"" Then + Rem + End If + Next iCount + Close #iNumber + Exit Sub +ErrorHandler: + Reset + MsgBox "All files will be closed",0,"Error" +End Sub + +
+ +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03060000.xhp b/helpcontent2/source/text/sbasic/shared/03060000.xhp new file mode 100644 index 000000000..18b196b22 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03060000.xhp @@ -0,0 +1,47 @@ + + + + + + + + +Logical Operators +/text/sbasic/shared/03060000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Logical Operators + The following logical operators are supported by $[officename] Basic. +
+ Logical operators combine (bitwise) the contents of two expressions or variables, for example, to test if specific bits are set or not. + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03060100.xhp b/helpcontent2/source/text/sbasic/shared/03060100.xhp new file mode 100644 index 000000000..1c4bf0bc3 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03060100.xhp @@ -0,0 +1,68 @@ + + + + + + + AND Operator + /text/sbasic/shared/03060100.xhp + + + + + + +
+ + AND operator (logical) + + + +AND Operator +Logically combines two expressions. +
+ +Syntax: + +Result = Expression1 And Expression2 + + +Parameters: + Result: Any numeric variable that records the result of the combination. + Expression1, Expression2: Any expressions that you want to combine. +Boolean expressions combined with AND only return the value True if both expressions evaluate to True: + True AND True returns True; for all other combinations the result is False. +The AND operator also performs a bitwise comparison of identically positioned bits in two numeric expressions. + +Example: + +Sub ExampleAnd +Dim A As Variant, B As Variant, C As Variant, D As Variant +Dim vVarOut As Variant + A = 10: B = 8: C = 6: D = Null + vVarOut = A > B And B > C ' returns -1 + vVarOut = B > A And B > C ' returns 0 + vVarOut = A > B And B > D ' returns 0 + vVarOut = (B > D And B > A) ' returns 0 + vVarOut = B And A ' returns 8 due to the bitwise And combination of both arguments +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03060200.xhp b/helpcontent2/source/text/sbasic/shared/03060200.xhp new file mode 100644 index 000000000..4ba146ac9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03060200.xhp @@ -0,0 +1,67 @@ + + + + + + + Eqv Operator + /text/sbasic/shared/03060200.xhp + + + + + + +
+ + Eqv operator (logical) + + + +Eqv Operator +Calculates the logical equivalence of two expressions. +
+ +Syntax: + +Result = Expression1 Eqv Expression2 + + +Parameters: + Result: Any numeric variable that contains the result of the comparison. + Expression1, Expression2: Any expressions that you want to compare. +When testing for equivalence between Boolean expressions, the result is True if both expressions are either True or False. +In a bit-wise comparison, the Eqv operator only sets the corresponding bit in the result if a bit is set in both expressions, or in neither expression. + +Example: + +Sub ExampleEqv +Dim A As Variant, B As Variant, C As Variant, D As Variantsee #i38265 +Dim vOut As Variant + A = 10: B = 8: C = 6: D = Null + vOut = A > B Eqv B > C ' returns -1 + vOut = B > A Eqv B > C ' returns 0 + vOut = A > B Eqv B > D ' returns 0 + vOut = (B > D Eqv B > A) ' returns -1 + vOut = B Eqv A ' returns -3 +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03060300.xhp b/helpcontent2/source/text/sbasic/shared/03060300.xhp new file mode 100644 index 000000000..041eb2736 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03060300.xhp @@ -0,0 +1,67 @@ + + + + + + + Imp Operator + /text/sbasic/shared/03060300.xhp + + + + + + +
+ + Imp operator (logical) + + + +Imp Operator +Performs a logical implication on two expressions. +
+ +Syntax: + +Result = Expression1 Imp Expression2 + + +Parameters: + Result: Any numeric variable that contains the result of the implication. + Expression1, Expression2: Any expressions that you want to evaluate with the Imp operator. +If you use the Imp operator in Boolean expressions, False is only returned if the first expression evaluates to True and the second expression to False. +If you use the Imp operator in bit expressions, a bit is deleted from the result if the corresponding bit is set in the first expression and the corresponding bit is deleted in the second expression. + +Example: + +Sub ExampleImp +Dim A As Variant, B As Variant, C As Variant, D As Variant +Dim vOut As Variant + A = 10: B = 8: C = 6: D = Null + vOut = A > B Imp B > C ' returns -1 + vOut = B > A Imp B > C ' returns -1 + vOut = A > B Imp B > D ' returns 0 + vOut = (B > D Imp B > A) ' returns -1 + vOut = B Imp A ' returns -1 +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03060400.xhp b/helpcontent2/source/text/sbasic/shared/03060400.xhp new file mode 100644 index 000000000..38bcd0123 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03060400.xhp @@ -0,0 +1,66 @@ + + + + + + + Not Operator + /text/sbasic/shared/03060400.xhp + + + + + + +
+ + Not operator (logical) + + + +Not Operator +Negates an expression by inverting the bit values. +
+ +Syntax: + +Result = Not Expression + + +Parameters: + Result: Any numeric variable that contains the result of the negation. + Expression: Any expression that you want to negate. +When a Boolean expression is negated, the value True changes to False, and the value False changes to True. +In a bitwise negation each individual bit is inverted. + +Example: + +Sub ExampleNot +Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant +Dim vOut As Variant + vA = 10: vB = 8: vC = 6: vD = Null + vOut = Not vA ' Returns -11 + vOut = Not(vC > vD) ' Returns -1 + vOut = Not(vB > vA) ' Returns -1 + vOut = Not(vA > vB) ' Returns 0 +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03060500.xhp b/helpcontent2/source/text/sbasic/shared/03060500.xhp new file mode 100644 index 000000000..d4652e7a5 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03060500.xhp @@ -0,0 +1,67 @@ + + + + + + + Or Operator + /text/sbasic/shared/03060500.xhp + + + + + + +
+ + Or operator (logical) + + + +Or Operator +Performs a logical OR disjunction on two expressions. +
+ +Syntax: + +Result = Expression1 Or Expression2 + + +Parameters: + Result: Any numeric variable that contains the result of the disjunction. + Expression1, Expression2: Any numeric expressions that you want to compare. +A logical OR disjunction of two Boolean expressions returns the value True if at least one comparison expression is True. +A bit-wise comparison sets a bit in the result if the corresponding bit is set in at least one of the two expressions. + +Example: + +Sub ExampleOr +Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant +Dim vOut As Variant + vA = 10: vB = 8: vC = 6: vD = Null + vOut = vA > vB Or vB > vC ' -1 + vOut = vB > vA Or vB > vC ' -1 + vOut = vA > vB Or vB > vD ' -1 + vOut = (vB > vD Or vB > vA) ' 0 + vOut = vB Or vA ' 10 +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03060600.xhp b/helpcontent2/source/text/sbasic/shared/03060600.xhp new file mode 100644 index 000000000..e2fa594dd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03060600.xhp @@ -0,0 +1,67 @@ + + + + + + + XOR Operator + /text/sbasic/shared/03060600.xhp + + + + + + +
+ + XOR operator (logical) + + + +XOR Operator +Performs a logical Exclusive-Or combination of two expressions. +
+ +Syntax: + +Result = Expression1 XOR Expression2 + + +Parameters: + Result: Any numeric variable that contains the result of the combination. + Expression1, Expression2: Any numeric expressions that you want to combine. +A logical Exclusive-Or conjunction of two Boolean expressions returns the value True only if both expressions are different from each other. +A bitwise Exclusive-Or conjunction returns a bit if the corresponding bit is set in only one of the two expressions. + +Example: + +Sub ExampleXOR +Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant +Dim vOut As Variant + vA = 10: vB = 8: vC = 6: vD = Null + vOut = vA > vB XOR vB > vC ' returns 0 + vOut = vB > vA XOR vB > vC ' returns -1 + vOut = vA > vB XOR vB > vD ' returns -1 + vOut = (vB > vD XOR vB > vA) ' returns 0 + vOut = vB XOR vA ' returns 2 +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03070000.xhp b/helpcontent2/source/text/sbasic/shared/03070000.xhp new file mode 100644 index 000000000..ecf4df3bd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03070000.xhp @@ -0,0 +1,47 @@ + + + + + + + + +Mathematical Operators +/text/sbasic/shared/03070000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Mathematical Operators + The following mathematical operators are supported in $[officename] Basic. +
+ This chapter provides a short overview of all of the arithmetical operators that you may need for calculations within a program. + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03070100.xhp b/helpcontent2/source/text/sbasic/shared/03070100.xhp new file mode 100644 index 000000000..f2d94d433 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03070100.xhp @@ -0,0 +1,66 @@ + + + + + + + "-" Operator + /text/sbasic/shared/03070100.xhp + + + + + + +
+ + "-" operator (mathematical) + + + +"-" Operator +Subtracts two values. +
+ +Syntax: + +Result = Expression1 - Expression2 + + +Parameters: + Result: Any numerical expression that contains the result of the subtraction. + Expression1, Expression2: Any numerical expressions that you want to subtract. + +Example: + +Sub ExampleSubtraction1 + Print 5 - 5 +End Sub + +Sub ExampleSubtraction2 +Dim iValue1 As Integer +Dim iValue2 As Integer + iValue1 = 5 + iValue2 = 10 + Print iValue1 - iValue2 +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03070200.xhp b/helpcontent2/source/text/sbasic/shared/03070200.xhp new file mode 100644 index 000000000..2f45997b5 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03070200.xhp @@ -0,0 +1,66 @@ + + + + + + + "*" Operator + /text/sbasic/shared/03070200.xhp + + + + + + +
+ + "*" operator (mathematical) + + + +"*" Operator +Multiplies two values. +
+ +Syntax: + +Result = Expression1 * Expression2 + + +Parameters: + Result: Any numeric expression that records the result of a multiplication. + Expression1, Expression2: Any numeric expressions that you want to multiply. + +Example: + +Sub ExampleMultiplication1 + Print 5 * 5 +End Sub + +Sub ExampleMultiplication2 +Dim iValue1 As Integer +Dim iValue2 As Integer + iValue1 = 5 + iValue2 = 10 + Print iValue1 * iValue2 +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03070300.xhp b/helpcontent2/source/text/sbasic/shared/03070300.xhp new file mode 100644 index 000000000..ecfaa55d5 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03070300.xhp @@ -0,0 +1,66 @@ + + + + + + + "+" Operator + /text/sbasic/shared/03070300.xhp + + + + + + +
+ + "+" operator (mathematical) + + + +"+" Operator +Adds or combines two expressions. +
+ +Syntax: + +Result = Expression1 + Expression2 + + +Parameters: + Result: Any numerical expression that contains the result of the addition. + Expression1, Expression2: Any numerical expressions that you want to combine or to add. + +Example: + +Sub ExampleAddition1 + Print 5 + 5 +End Sub + +Sub ExampleAddition2 +Dim iValue1 As Integer +Dim iValue2 As Integer + iValue1 = 5 + iValue2 = 10 + Print iValue1 + iValue2 +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03070400.xhp b/helpcontent2/source/text/sbasic/shared/03070400.xhp new file mode 100644 index 000000000..3e93644e4 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03070400.xhp @@ -0,0 +1,66 @@ + + + + + + + "/" Operator + /text/sbasic/shared/03070400.xhp + + + + + + +
+ + "/" operator (mathematical) + + + +"/" Operator +Divides two values. +
+ +Syntax: + +Result = Expression1 / Expression2 + + +Parameters: + Result: Any numerical value that contains the result of the division. + Expression1, Expression2: Any numerical expressions that you want to divide. + +Example: + +Sub ExampleDivision1 + Print 5 / 5 +End Sub + +Sub ExampleDivision2 +Dim iValue1 As Integer +Dim iValue2 As Integer + iValue1 = 5 + iValue2 = 10 + Print iValue1 / iValue2 +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03070500.xhp b/helpcontent2/source/text/sbasic/shared/03070500.xhp new file mode 100644 index 000000000..798cf06c2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03070500.xhp @@ -0,0 +1,60 @@ + + + + + + + "^" Operator + /text/sbasic/shared/03070500.xhp + + + + + + +
+ + "^" operator (mathematical) + + + +"^" Operator +Raises a number to a power. +
+ +Syntax: + +Result = Expression ^ Exponent + + +Parameters: + Result: Any numerical expression that contains the result of the number raised to a power. + Expression: Numerical value that you want to raise to a power. + Exponent: The value of the power that you want to raise the expression to. + +Example: + +Sub Example + Print ( 12.345 ^ 23 ) + Print Exp ( 23 * Log( 12.345 ) ) ' Raises by forming a logarithm +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03070600.xhp b/helpcontent2/source/text/sbasic/shared/03070600.xhp new file mode 100644 index 000000000..42516188e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03070600.xhp @@ -0,0 +1,66 @@ + + + + + + + Mod Operator + /text/sbasic/shared/03070600.xhp + + + + + + +
+ + MOD operator (mathematical) + + + +Mod Operator +Returns the integer remainder of a division. +
+ +Syntax: + +Result = Expression1 MOD Expression2 + + +Return value: +Integer + +Parameters: + Result: Any numeric variable that contains the result of the MOD operation. + Expression1, Expression2: Any numeric expressions that you want to divide. + +Example: + +Sub ExampleMod + Print 10 Mod 2.5 ' returns 0 + Print 10 / 2.5 ' returns 4 + Print 10 Mod 5 ' returns 0 + Print 10 / 5 ' returns 2 + Print 5 Mod 10 ' returns 5 + Print 5 / 10 ' returns 0.5 +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080000.xhp b/helpcontent2/source/text/sbasic/shared/03080000.xhp new file mode 100644 index 000000000..38e89ffa8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080000.xhp @@ -0,0 +1,48 @@ + + + + + + + + +Numeric Functions +/text/sbasic/shared/03080000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Numeric Functions + The following numeric functions perform calculations. Mathematical and Boolean operators are described in a separate section. Functions differ from operators in that functions pass arguments and return a result, instead of operators that return a result by combining two numeric expressions. +
+ + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080100.xhp b/helpcontent2/source/text/sbasic/shared/03080100.xhp new file mode 100644 index 000000000..9e50eae34 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080100.xhp @@ -0,0 +1,44 @@ + + + + + + + + +Trigonometric Functions +/text/sbasic/shared/03080100.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Trigonometric Functions + The following are the trigonometric functions that are supported in $[officename] Basic. +
+ + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080101.xhp b/helpcontent2/source/text/sbasic/shared/03080101.xhp new file mode 100644 index 000000000..af0a6db97 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080101.xhp @@ -0,0 +1,70 @@ + + + + + + + Atn Function + /text/sbasic/shared/03080101.xhp + + + + +
+ +Atn function + + Atn Function + Trigonometric function that returns the arctangent of a numeric expression. The return value is in the range -Pi/2 to +Pi/2. +
+ The arctangent is the inverse of the tangent function. The Atn Function returns the angle "Alpha", expressed in radians, using the tangent of this angle. The function can also return the angle "Alpha" by comparing the ratio of the length of the side that is opposite of the angle to the length of the side that is adjacent to the angle in a right-angled triangle. + Atn(side opposite the angle/side adjacent to angle)= Alpha + + + + Atn (Number) + + + Double + + + Number: Any numerical expression that represents the ratio of two sides of a right triangle. The Atn function returns the corresponding angle in radians (arctangent). + To convert radians to degrees, multiply radians by 180/pi. + degree=(radian*180)/pi + radian=(degree*pi)/180 + Pi is here the fixed circle constant with the rounded value 3.14159. Pi is a Basic mathematical constant. + + + + + + ' The following example calculates for a right-angled triangle + ' the angle Alpha from the tangent of the angle Alpha: + Sub ExampleAtn + ' rounded Pi = 3.14159 Is a predefined constant + Dim d1 As Double + Dim d2 As Double + d1 = InputBox("Enter the length of the side adjacent to the angle: ","Adjacent") + d2 = InputBox("Enter the length of the side opposite the angle: ","Opposite") + Print "The Alpha angle is"; (atn (d2/d1) * 180 / Pi); " degrees" + End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080102.xhp b/helpcontent2/source/text/sbasic/shared/03080102.xhp new file mode 100644 index 000000000..908daeec3 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080102.xhp @@ -0,0 +1,74 @@ + + + + + + + Cos Function + /text/sbasic/shared/03080102.xhp + + + + + + +
+ + Cos function + + + +Cos Function +Calculates the cosine of an angle. The angle is specified in radians. The result lies between -1 and 1. +
+Using the angle Alpha, the Cos-Function calculates the ratio of the length of the side that is adjacent to the angle, divided by the length of the hypotenuse in a right-angled triangle. +Cos(Alpha) = Adjacent/Hypotenuse + +Syntax: + +Cos (Number) + + +Return value: +Double + +Parameters: + Number: Numeric expression that specifies an angle in radians that you want to calculate the cosine for. +To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi. +degree=(radian*180)/pi +radian=(degree*pi)/180 +Pi is here the fixed circle constant with the rounded value 3.14159... + + + +Example: + +' The following example allows for a right-angled triangle the input of +' secant and angle (in degrees) and calculates the length of the hypotenuse: +Sub ExampleCosinus +' rounded Pi = 3.14159 +Dim d1 As Double, dAngle As Double + d1 = InputBox("Enter the length of the adjacent side: ","Adjacent") + dAngle = InputBox("Enter the angle Alpha (in degrees): ","Alpha") + Print "The length of the hypothenuse is"; (d1 / cos (dAngle * Pi / 180)) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03080103.xhp b/helpcontent2/source/text/sbasic/shared/03080103.xhp new file mode 100644 index 000000000..bc3a81c2b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080103.xhp @@ -0,0 +1,75 @@ + + + + + + + Sin Function + /text/sbasic/shared/03080103.xhp + + + + + + +
+ + Sin function + + + +Sin Function +Returns the sine of an angle. The angle is specified in radians. The result lies between -1 and 1. +
+Using the angle Alpha, the Sin Function returns the ratio of the length of the opposite side of an angle to the length of the hypotenuse in a right-angled triangle. +Sin(Alpha) = side opposite the angle/hypotenuse + +Syntax: + +Sin (Number) + + +Return value: +Double + +Parameters: + Number: Numeric expression that defines the angle in radians that you want to calculate the sine for. +To convert degrees to radians, multiply degrees by Pi/180, and to convert radians to degrees, multiply radians by 180/Pi. +grad=(radiant*180)/pi +radiant=(grad*pi)/180 +Pi is approximately 3.141593. + + + +Example: + +' In this example, the following entry is possible for a right-angled triangle: +' The side opposite the angle and the angle (in degrees) to calculate the length of the hypotenuse: +Sub ExampleSine +' Pi = 3.1415926 is a predefined variable +Dim d1 As Double +Dim dAlpha As Double + d1 = InputBox("Enter the length of the opposite side: ","Opposite Side") + dAlpha = InputBox("Enter the angle Alpha (in degrees): ","Alpha") + Print "The length of the hypotenuse is"; (d1 / sin (dAlpha * Pi / 180)) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03080104.xhp b/helpcontent2/source/text/sbasic/shared/03080104.xhp new file mode 100644 index 000000000..2fe6d7159 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080104.xhp @@ -0,0 +1,75 @@ + + + + + + + Tan Function + /text/sbasic/shared/03080104.xhp + + + + + + +
+ + Tan function + + + +Tan Function +Determines the tangent of an angle. The angle is specified in radians.i71396 +
+Using the angle Alpha, the Tan Function calculates the ratio of the length of the side opposite the angle to the length of the side adjacent to the angle in a right-angled triangle. +Tan(Alpha) = side opposite the angle/side adjacent to angle + +Syntax: + +Tan (Number) + + +Return value: +Double + +Parameters: + Number: Any numeric expression that you want to calculate the tangent for (in radians). +To convert degrees to radians, multiply by Pi/180. To convert radians to degrees, multiply by 180/Pi. +degrees=(radiant*180)/Pi +radiant=(degrees*Pi)/180 +Pi is approximately 3.141593. + + + +Example: + +' In this example, the following entry is possible for a right-angled triangle: +' The side opposite the angle and the angle (in degrees) to calculate the length of the side adjacent to the angle: +Sub ExampleTangens +' Pi = 3.1415926 is a pre-defined variable +Dim d1 As Double +Dim dAlpha As Double + d1 = InputBox("Enter the length of the side opposite the angle: ","opposite") + dAlpha = InputBox("Enter the Alpha angle (in degrees): ","Alpha") + Print "the length of the side adjacent the angle is"; (d1 / tan (dAlpha * Pi / 180)) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03080200.xhp b/helpcontent2/source/text/sbasic/shared/03080200.xhp new file mode 100644 index 000000000..66b019353 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080200.xhp @@ -0,0 +1,42 @@ + + + + + + + + +Exponential and Logarithmic Functions +/text/sbasic/shared/03080200.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Exponential and Logarithmic Functions + $[officename] Basic supports the following exponential and logarithmic functions. +
+ + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080201.xhp b/helpcontent2/source/text/sbasic/shared/03080201.xhp new file mode 100644 index 000000000..9847e8af7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080201.xhp @@ -0,0 +1,64 @@ + + + + + + + Exp Function + /text/sbasic/shared/03080201.xhp + + + + + +
+ + Exp function + + +Exp Function +Returns the base of the natural logarithm (e = 2.718282) raised to a power. +
+ +Syntax: + +Exp (Number) + + +Return value: +Double + +Parameters: + Number: Any numeric expression that specifies the power that you want to raise "e" to (the base of natural logarithms). The power must be for both single-precision numbers less than or equal to 88.02969 and double-precision numbers less than or equal to 709.782712893, since $[officename] Basic returns an Overflow error for numbers exceeding these values. + + + +Example: + +Sub ExampleLogExp +Dim dValue As Double + Const b1=12.345e12 +Const b2=1.345e34 + dValue=Exp( Log(b1)+Log(b2) ) + MsgBox "" & dValue & chr(13) & (b1*b2) ,0,"Multiplication by logarithm" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080202.xhp b/helpcontent2/source/text/sbasic/shared/03080202.xhp new file mode 100644 index 000000000..3d8c819d3 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080202.xhp @@ -0,0 +1,69 @@ + + + + + + + Log Function + /text/sbasic/shared/03080202.xhp + + + + + + +
+ + Log function + + + +Log Function +Returns the natural logarithm of a number. +
+ +Syntax: + +Log (Number) + + +Return value: +Double + +Parameters: + Number: Any numeric expression that you want to calculate the natural logarithm for. +The natural logarithm is the logarithm to the base e. Base e is a constant with an approximate value of 2.718282... +You can calculate logarithms to any base (n) for any number (x) by dividing the natural logarithm of x by the natural logarithm of n, as follows: +Log n(x) = Log(x) / Log(n) + + + +Example: + +Sub ExampleLogExp +Dim a As Double +Dim Const b1=12.345e12 +Dim Const b2=1.345e34 + a=Exp( Log(b1)+Log(b2) ) + MsgBox "" & a & chr(13) & (b1*b2) ,0,"Multiplication by logarithm function" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03080300.xhp b/helpcontent2/source/text/sbasic/shared/03080300.xhp new file mode 100644 index 000000000..0bc433da5 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080300.xhp @@ -0,0 +1,42 @@ + + + + + + + + +Generating Random Numbers +/text/sbasic/shared/03080300.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Generating Random Numbers + The following statements and functions generate random numbers. +
+ + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080301.xhp b/helpcontent2/source/text/sbasic/shared/03080301.xhp new file mode 100644 index 000000000..c846b1501 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080301.xhp @@ -0,0 +1,74 @@ + + + + + + + Randomize Statement + /text/sbasic/shared/03080301.xhp + + + + + + +
+ + Randomize statement + + + +Randomize Statement +Initializes the random-number generator used by the Rnd function. +
+ +Syntax: + +Randomize [Number] + +Parameters: + Number: Any integer value. Used as seed to initialize the random-number generator. Equal seeds result in equal random-number sequences by the Rnd function. If the parameter is omitted, the Randomize statement will be ignored. +Unless a predictable sequence of numbers is desired, there is no need to use the Randomize statement, as the random-number generator will be initialized automatically at first use – it will be seeded using a system-provided random-number generator that produces uniformly-distributed, non-deterministic random numbers. If no such generator is available on the system, the system time will be used as seed. +The Randomize statement affects BASIC's Rnd function only. Other random-number generators (for example the Calc's RAND() function, etc.) are not affected by it. + + + +Example: + +Sub ExampleRandomize +Dim iCount As Integer, iVar As Integer, sText As String +Dim iSpectral(10) As Integer + Randomize 2^14-1 + For iCount = 1 To 1000 + iVar = Int(10 * Rnd) ' Range from 0 to 9 + iSpectral(iVar) = iSpectral(iVar) +1 + Next iCount + sText = " | " + For iCount = 0 To 9 + sText = sText & iSpectral(iCount) & " | " + Next iCount + MsgBox sText,0,"Spectral Distribution" +End Sub + +
+ +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080302.xhp b/helpcontent2/source/text/sbasic/shared/03080302.xhp new file mode 100644 index 000000000..e898be390 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080302.xhp @@ -0,0 +1,76 @@ + + + + + + + Rnd Function + /text/sbasic/shared/03080302.xhp + + + + + + +
+ + Rnd function + + + +Rnd Function +Returns a random number between 0 and 1. +
+ +Syntax: + +Rnd [(Expression)] + +Return value: +Double + +Parameters: + Expression: Has no effect, is ignored if provided. +The Rnd function returns decimal fractions ranging from 0 (included) to 1 (excluded) according to a uniform distribution. It uses the Mersenne Twister 19937 random-number generator. To generate random integers in a given range, use a formula like in the example below. A Randomize statement with a defined seed value can be used beforehand, if a predictable sequence of numbers is desired. + + + +Example: + +Sub ExampleRandomSelect +Dim iVar As Integer + iVar = Int((15 * Rnd) -2) + Select Case iVar + Case 1 To 5 + Print "Number from 1 to 5" + Case 6, 7, 8 + Print "Number from 6 to 8" + Case Is > 8 And iVar < 11 + Print "Greater than 8" + Case Else + Print "Outside range 1 to 10" + End Select +End Sub + +
+ +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080400.xhp b/helpcontent2/source/text/sbasic/shared/03080400.xhp new file mode 100644 index 000000000..3a8aef25b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080400.xhp @@ -0,0 +1,41 @@ + + + + + + + + +Square Root Calculation +/text/sbasic/shared/03080400.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Square Root Calculation + Use this function to calculate square roots. +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080401.xhp b/helpcontent2/source/text/sbasic/shared/03080401.xhp new file mode 100644 index 000000000..229edef58 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080401.xhp @@ -0,0 +1,65 @@ + + + + + + + Sqr Function + /text/sbasic/shared/03080401.xhp + + + + + + +
+ + Sqr function + + + +Sqr Function +Calculates the square root of a numeric expression. +
+ +Syntax: + +Sqr (Number) + + +Return value: +Double + +Parameters: + Number: Any numeric expression that you want to calculate the square root for. +A square root is the number that you multiply by itself to produce another number, for example, the square root of 36 is 6. + + + +Example: + +Sub ExampleSqr +Dim iVar As Single + iVar = 36 + MsgBox Sqr(iVar) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03080500.xhp b/helpcontent2/source/text/sbasic/shared/03080500.xhp new file mode 100644 index 000000000..06efe78a2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080500.xhp @@ -0,0 +1,43 @@ + + + + + + + + +Integers +/text/sbasic/shared/03080500.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Integers and Fractional + Functions to round values to integers, and to take the fractional part of a value. +
+ + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080501.xhp b/helpcontent2/source/text/sbasic/shared/03080501.xhp new file mode 100644 index 000000000..97e9ee82f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080501.xhp @@ -0,0 +1,64 @@ + + + + + + + Fix Function + /text/sbasic/shared/03080501.xhp + + + + + + +
+ + Fix function + +Fix Function +Returns the integer value of a numeric expression by removing the fractional part of the number. +
+ + +Fix (Expression) + + +Double + + + Expression: Numeric expression that you want to return the integer value for. + + + + + +Sub ExampleFix + Print Fix(3.14159) ' returns 3. + Print Fix(0) ' returns 0. + Print Fix(-3.14159) ' returns -3. +End Sub + +
+ Int Function + Frac Function +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080502.xhp b/helpcontent2/source/text/sbasic/shared/03080502.xhp new file mode 100644 index 000000000..61ad8390c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080502.xhp @@ -0,0 +1,66 @@ + + + + + + + Int Function + /text/sbasic/shared/03080502.xhp + + + + + + +
+ + Int function + + + +Int Function +Returns the integer portion of a number. +
+ + +Int (Number) + + +Double + + + Number: Any valid numeric expression. + + + + + +Sub ExampleInt + Print Int(3.99) ' returns the value 3 + Print Int(0) ' returns the value 0 + Print Int(-3.14159) ' returns the value -4 +End Sub + +
+ Fix Function + Frac Function +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080503.xhp b/helpcontent2/source/text/sbasic/shared/03080503.xhp new file mode 100644 index 000000000..64e7fc9a0 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080503.xhp @@ -0,0 +1,47 @@ + + + + + + + Frac Function + /text/sbasic/shared/03080503.xhp + + + +
+ + Frac function + +

Frac Function

+ Returns the fractional portion of a number. +
+ + Frac (Number) + + Double + + Number: Any valid numeric expression. + + + + + Sub ExampleFrac + Print Frac(3.99) ' returns the value 0.99 + Print Frac(0) ' returns the value 0 + Print Frac(-3.14159) ' returns the value -0.14159 + End Sub + +
+ Fix Function + Int Function +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03080600.xhp b/helpcontent2/source/text/sbasic/shared/03080600.xhp new file mode 100644 index 000000000..416e2964d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080600.xhp @@ -0,0 +1,41 @@ + + + + + + + + +Absolute Values +/text/sbasic/shared/03080600.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Absolute Values + This function returns absolute values. +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080601.xhp b/helpcontent2/source/text/sbasic/shared/03080601.xhp new file mode 100644 index 000000000..39aa93be1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080601.xhp @@ -0,0 +1,67 @@ + + + + + + + Abs Function + /text/sbasic/shared/03080601.xhp + + + + + + +
+ + Abs function + + + +Abs Function +Returns the absolute value of a numeric expression. +
+ +Syntax: + +Abs (Number) + + +Return value: +Double + +Parameters: + Number: Any numeric expression that you want to return the absolute value for. Positive numbers, including 0, are returned unchanged, whereas negative numbers are converted to positive numbers. +The following example uses the Abs function to calculate the difference between two values. It does not matter which value you enter first. + + + +Example: + +Sub ExampleDifference +Dim siW1 As Single +Dim siW2 As Single + siW1 = Int(InputBox("Please enter the first amount","Value Input")) + siW2 = Int(InputBox("Please enter the second amount","Value Input")) + Print "The difference is "; Abs(siW1 - siW2) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03080700.xhp b/helpcontent2/source/text/sbasic/shared/03080700.xhp new file mode 100644 index 000000000..789135e9b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080700.xhp @@ -0,0 +1,41 @@ + + + + + + + + +Expression Signs +/text/sbasic/shared/03080700.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Expression Signs + This function returns the algebraic sign of a numeric expression. +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080701.xhp b/helpcontent2/source/text/sbasic/shared/03080701.xhp new file mode 100644 index 000000000..d96fdd1f6 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080701.xhp @@ -0,0 +1,100 @@ + + + + + + + Sgn Function + /text/sbasic/shared/03080701.xhp + + + + + + +
+ + Sgn function + + + +Sgn Function +Returns an integer number between -1 and 1 that indicates if the number that is passed to the function is positive, negative, or zero. +
+ +Syntax: + +Sgn (Number) + + +Return value: +Integer + +Parameters: + Number: Numeric expression that determines the value that is returned by the function. + + + + + NumExpression + + + Return value + + + + + negative + + + Sgn returns -1. + + + + + 0 + + + Sgn returns 0. + + + + + positive + + + Sgn returns 1. + + +
+ + + + +Example: + +Sub ExampleSgn + Print sgn(-10) ' returns -1 + Print sgn(0) ' returns 0 + Print sgn(10) ' returns 1 +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03080800.xhp b/helpcontent2/source/text/sbasic/shared/03080800.xhp new file mode 100644 index 000000000..cfb91e92c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080800.xhp @@ -0,0 +1,42 @@ + + + + + + + + +Converting Numbers +/text/sbasic/shared/03080800.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Converting Numbers + The following functions convert numbers from one number format to another. +
+ + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03080801.xhp b/helpcontent2/source/text/sbasic/shared/03080801.xhp new file mode 100644 index 000000000..82d5bb968 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080801.xhp @@ -0,0 +1,78 @@ + + + + + + + Hex Function + /text/sbasic/shared/03080801.xhp + + + + + + +
+ + Hex function + + + +Hex Function +Returns a string that represents the hexadecimal value of a number. +
+ +Syntax: + +Hex (Number) + + +Return value: +String + +Parameters: + Number: Any numeric expression that you want to convert to a hexadecimal number. + + + +Example: + +Sub ExampleHex +' uses BasicFormulas in %PRODUCTNAME Calc +Dim a2, b2, c2 As String + a2 = "&H3E8" + b2 = Hex2Lng(a2) + MsgBox b2 + c2 = Lng2Hex(b2) + MsgBox c2 +End Sub + +Function Hex2Lng(sHex As String) As Long +' Returns a 32-bit signed integer number from an 8-digit hexadecimal value. + Hex2Lng = clng( sHex ) +End Function + +Function Lng2Hex(iLong As Long) As String +' Calculates the 8-digit hexadecimal value out of a 32-bit signed integer number. + Lng2Hex = "&H" & Hex( iLong ) +End Function + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03080802.xhp b/helpcontent2/source/text/sbasic/shared/03080802.xhp new file mode 100644 index 000000000..14910c900 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080802.xhp @@ -0,0 +1,62 @@ + + + + + + + Oct Function + /text/sbasic/shared/03080802.xhp + + + + + + +
+ + Oct function + + + +Oct Function +Returns the octal value of a number. +
+ +Syntax: + +Oct (Number) + + +Return value: +String + +Parameters: + Number: Any numeric expression that you want to convert to an octal value. + + + +Example: + +Sub ExampleOct + MsgBox Oct(255) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090000.xhp b/helpcontent2/source/text/sbasic/shared/03090000.xhp new file mode 100644 index 000000000..410059905 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090000.xhp @@ -0,0 +1,45 @@ + + + + + + + + +Controlling Program Execution +/text/sbasic/shared/03090000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Controlling Program Execution + The following statements control the execution of a program. +
+ A program generally executes from the first line of code to the last line of code. You can also execute certain procedures within the program according to specific conditions, or repeat a section of the program within a sub-procedure or function. You can use loops to repeat parts of a program as many times as necessary, or until a certain condition is met. These type of control statements are classified as Condition, Loop, or Jump statements. + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090100.xhp b/helpcontent2/source/text/sbasic/shared/03090100.xhp new file mode 100644 index 000000000..a27d2a66c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090100.xhp @@ -0,0 +1,43 @@ + + + + + + + + +Condition Statements +/text/sbasic/shared/03090100.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Condition Statements + The following statements are based on conditions. +
+ + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090101.xhp b/helpcontent2/source/text/sbasic/shared/03090101.xhp new file mode 100644 index 000000000..71832b815 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090101.xhp @@ -0,0 +1,74 @@ + + + + + + + If...Then...Else Statement + /text/sbasic/shared/03090101.xhp + + + + + + +
+ + If statement + + + +If...Then...Else Statement +Defines one or more statement blocks that you only want to execute if a given condition is True. +
+ +Syntax: + +If condition=true Then Statement block [ElseIf condition=true Then] Statement block [Else] Statement block EndIf + +Instead of Else If you can write ElseIf, instead of End If you can write EndIf. + +Parameters: +The If...Then statement executes program blocks depending on given conditions. When $[officename] Basic encounters an If statement, the condition is tested. If the condition is True, all subsequent statements up to the next Else or ElseIf statement are executed. If the condition is False, and an ElseIf statement follows, $[officename] Basic tests the next condition and executes the following statements if the condition is True. If False, the program continues either with the next ElseIf or Else statement. Statements following Else are executed only if none of the previously tested conditions were True. After all conditions are evaluated, and the corresponding statements executed, the program continues with the statement following EndIf. +You can nest multiple If...Then statements. + Else and ElseIf statements are optional. +You can use GoTo and GoSub to jump out of an If...Then block, but not to jump into an If...Then structure. +The following example enables you to enter the expiration date of a product, and determines if the expiration date has passed. + +Example: + +Sub ExampleIfThenDate +Dim sDate As String +Dim sToday As String + sDate = InputBox("Enter the expiration date (MM.DD.YYYY)") + sDate = Right$(sDate, 4) + Mid$(sDate, 4, 2) + Left$(sDate, 2) + sToday = Date$ + sToday = Right$(sToday, 4)+ Mid$(sToday, 4, 2) + Left$(sToday, 2) + If sDate < sToday Then + MsgBox "The expiration date has passed" + ElseIf sDate > sToday Then + MsgBox "The expiration date has not yet passed" + Else + MsgBox "The expiration date is today" + End If +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090102.xhp b/helpcontent2/source/text/sbasic/shared/03090102.xhp new file mode 100644 index 000000000..7d9eb53cc --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090102.xhp @@ -0,0 +1,71 @@ + + + + + + + Select...Case Statement + /text/sbasic/shared/03090102.xhp + + + + + + +
+ + Select Case statement + Case keyword; in Select Case statement + + + +Select...Case Statement +Defines one or more statement blocks depending on the value of an expression. +
+ + +Select Case syntax + +Select Case condition Case expression Statement Block [Case expression2 Statement Block][Case Else] Statement Block End Select + + + + condition: Any expression that controls if the statement block that follows the respective Case clause is executed. + expression: Any expression that is compatible with the condition type expression. The statement block that follows the Case clause is executed if condition matches expression. + + + +Sub ExampleRandomSelect +Dim iVar As Integer + iVar = Int((15 * Rnd) -2) + Select Case iVar + Case 1 To 5 + Print "Number from 1 to 5" + Case 6, 7, 8 + Print "Number from 6 to 8" + Case 8 To 10 + Print "Greater than 8" + Case Else + Print "Out of range 1 to 10" + End Select +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090103.xhp b/helpcontent2/source/text/sbasic/shared/03090103.xhp new file mode 100644 index 000000000..8b53d87dd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090103.xhp @@ -0,0 +1,51 @@ + + + + + + + +IIf Statement +/text/sbasic/shared/03090103.xhp + + +Sun Microsystems, Inc. + + + +
+IIf statement + +IIf Statement +Returns one of two possible function results, depending on the logical value of the evaluated expression. +
+Syntax: + +IIf (Expression, ExpressionTrue, ExpressionFalse) + +Parameters: + +Expression: Any expression that you want to evaluate. If the expression evaluates to True, the function returns the result of ExpressionTrue, otherwise it returns the result of ExpressionFalse. + +ExpressionTrue, ExpressionFalse: Any expression, one of which will be returned as the function result, depending on the logical evaluation. + + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03090200.xhp b/helpcontent2/source/text/sbasic/shared/03090200.xhp new file mode 100644 index 000000000..4f91a4715 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090200.xhp @@ -0,0 +1,43 @@ + + + + + + + + +Loops +/text/sbasic/shared/03090200.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Loops + The following statements execute loops. +
+ + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090201.xhp b/helpcontent2/source/text/sbasic/shared/03090201.xhp new file mode 100644 index 000000000..9606ac66b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090201.xhp @@ -0,0 +1,103 @@ + + + + + + + Do...Loop Statement + /text/sbasic/shared/03090201.xhp + + + + + + +
+ + Do...Loop statement + While; Do loop + Until + loops + + + +Do...Loop Statement +Repeats the statements between the Do and the Loop statement while the condition is True or until the condition becomes True. +
+ +Syntax +Do [{While | Until} condition = True] +statement block +[Exit Do] +statement block +Loop +or +Do +statement block +[Exit Do] +statement block +Loop [{While | Until} condition = True] + +Parameters/Elements + Condition: A comparison, numeric or string expression, that evaluates either True or False. + Statement block: Statements that you want to repeat while or until the condition is True. +The Do...Loop statement executes a loop as long as, or until, a certain condition is True. The condition for exiting the loop must be entered following either the Do or the Loop statement. The following examples are valid combinations: + +Syntax +Do While condition = True +...statement block +Loop +The statement block between the Do While and the Loop statements is repeated so long as the condition is true. +Do Until condition = True +...statement block +Loop +The statement block between the Do Until and the Loop statements is repeated if the condition so long as the condition is false. +Do +...statement block +Loop While condition = True +The statement block between the Do and the Loop statements repeats so long as the condition is true. +Do +...statement block +Loop Until condition = True +The statement block between the Do and the Loop statements repeats until the condition is true. +Use the Exit Do statement to unconditionally end the loop. You can add this statement anywhere in a Do...Loop statement. You can also define an exit condition using the If...Then structure as follows: +Do... +statements +If condition = True Then Exit Do +statements +Loop... + +Example + +Sub ExampleDoLoop +Dim sFile As String +Dim sPath As String + sPath = "c:\" + sFile = Dir$( sPath ,22) + If sFile <> "" Then + Do + MsgBox sFile + sFile = Dir$ + Loop Until sFile = "" + End If +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090202.xhp b/helpcontent2/source/text/sbasic/shared/03090202.xhp new file mode 100644 index 000000000..7fc43cdf4 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090202.xhp @@ -0,0 +1,124 @@ + + + + + + + For...Next Statement + /text/sbasic/shared/03090202.xhp + + + + + + +
+ + For statement + For Each statement + In keyword + Next keyword + Step keyword + To keyword + Step keyword + + + +

For...Next Statement

+ Repeats the statements between the For...Next block a specified number of times. +
+ +

Syntax:

+ + For Statement diagram + + +For counter=start To end [Step step] + statement-block + [Exit For] + statement-block +Next [counter] + + + For Each Statement diagram + + + For Each item In list + statement-block + [Exit For] + statement-block + Next [item] + + +

Variables:

+ counter: Loop counter initially assigned the value to the right of the equal sign (start). Only numeric variables are valid. The loop counter increases or decreases according to the variable step until end is passed. + start: Numeric variable that defines the initial value at the beginning of the loop. + end: Numeric variable that defines the final value at the end of the loop. + step: Sets the value by which to increase or decrease the loop counter. If step is not specified, the loop counter is incremented by 1. In this case, end must be greater than start. If you want to decrease counter, end must be less than start, and step must be assigned a negative value. +The For...Next loop repeats all of the statements in the loop for the number of times that is specified by the parameters. +As the counter variable is decreased, %PRODUCTNAME Basic checks if the end value has been reached. As soon as the counter passes the end value, the loop automatically terminates. +It is possible to nest For...Next statements. If you do not specify a variable following the Next statement, Next automatically refers to the most recent For statement. +If you specify an increment of 0, the statements between For and Next are repeated continuously. +When counting down the counter variable, %PRODUCTNAME Basic checks for overflow or underflow. The loop ends when counter exceeds end (positive Step value) or is less than end (negative Step value). +Use the Exit For statement to exit the loop unconditionally. This statement must be within a For...Next loop. Use the If...Then statement to test the exit condition as follows: + + For... + statement-block + If condition = True Then Exit For + statement-block + Next + + +In nested For...Next loops, if you exit a loop unconditionally with Exit For, only one loop is exited. + +

Examples

+The following example uses two nested loops to sort a string array with 10 elements ( sEntry() ), that is filled with various contents: + +Sub ExampleSort +Dim sEntry(9) As String +Dim iCount As Integer, iCount2 As Integer +Dim sTemp As String + sEntry = Array("Jerry","Patty","Kurt","Thomas","Michael",_ + "David","Cathy","Susie","Edward","Christine") + For iCount = 0 To 9 + For iCount2 = iCount + 1 To 9 + If sEntry(iCount) > sEntry(iCount2) Then + sTemp = sEntry(iCount) + sEntry(iCount) = sEntry(iCount2) + sEntry(iCount2) = sTemp + End If + Next iCount2 + Next iCount + For iCount = 0 To 9 + Print sEntry(iCount) + Next iCount +End Sub + +This explores the content of an array to display each item it contains. + + Sub list_iteration + cutlery = Array("fork", "knife", "spoon") + For Each item in cutlery + Print item + Next ' item + End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090203.xhp b/helpcontent2/source/text/sbasic/shared/03090203.xhp new file mode 100644 index 000000000..c29905c08 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090203.xhp @@ -0,0 +1,58 @@ + + + + + + + +While...Wend Statement +/text/sbasic/shared/03090203.xhp + + +Sun Microsystems, Inc. + + + + +
+ While;While...Wend loopWhile...Wend Statement + When a program encounters a While statement, it tests the condition. If the condition is False, the program continues directly following the Wend statement. If the condition is True, the loop is executed until the program finds Wend and then jumps back to the While statement. If the condition is still True, the loop is executed again. +
+ Unlike the Do...Loop statement, you cannot cancel a While...Wend loop with Exit. Never exit a While...Wend loop with GoTo, since this can cause a run-time error. + A Do...Loop is more flexible than a While...Wend. + Syntax: + +While Condition [Statement] Wend + + Example: + + Sub ExampleWhileWend + Dim stext As String + Dim iRun As Integer + sText ="This Is a short text" + iRun = 1 + While iRun < Len(sText) + If Mid(sText,iRun,1 )<> " " Then Mid( sText ,iRun, 1, Chr( 1 + Asc( Mid(sText,iRun,1 )) ) + iRun = iRun + 1 + Wend + MsgBox sText,0,"Text encoded" + End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090300.xhp b/helpcontent2/source/text/sbasic/shared/03090300.xhp new file mode 100644 index 000000000..c0d96aa8d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090300.xhp @@ -0,0 +1,43 @@ + + + + + + + + +Jumps +/text/sbasic/shared/03090300.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Jumps + The following statements execute jumps. +
+ + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090301.xhp b/helpcontent2/source/text/sbasic/shared/03090301.xhp new file mode 100644 index 000000000..b2331842b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090301.xhp @@ -0,0 +1,91 @@ + + + + + + + GoSub...Return Statement + /text/sbasic/shared/03090301.xhp + + + + + +
+ + GoSub...Return statement + label; in GoSub...Return statement + + +

GoSub...Return Statement

+ Calls a subroutine that is indicated by a label inside a Sub or a Function. The statements following the label are executed until the next Return statement. Afterwards, the program continues with the statement that follows the GoSub statement. +
+ + + +GoSub label[:] + + + +label: A line identifier indicating where to continue execution. The scope of a label in that of the routine it belongs to. +The GoSub statement calls a local subroutine indicated by a label from within a subroutine or a function. The name of the label must end with a colon (":"). + + Sub/Function foo + ' statements + GoSub label + ' statements + Exit Sub/Function + label: + ' statements + Return + End Sub/Function + + +If the program encounters a Return statement not preceded by GoSub, $[officename] Basic returns an error message. Use Exit Sub or Exit Function to ensure that the program leaves a Sub or Function before reaching the next Return statement. +The following example demonstrates the use of GoSub and Return. By executing a program section twice, the program calculates the square root of two numbers that are entered by the user. + + + +Sub ExampleGoSub +Dim iInputa As Single +Dim iInputb As Single +Dim iInputc As Single + iInputa = Int(InputBox("Enter the first number: ","NumberInput")) + iInputb = Int(InputBox("Enter the second number: ","NumberInput")) + iInputc=iInputa + GoSub SquareRoot + Print "The square root of";iInputa;" is";iInputc + iInputc=iInputb + GoSub SquareRoot + Print "The square root of";iInputb;" is";iInputc + Exit Sub +SquareRoot: + iInputc=sqr(iInputc) + Return +End Sub + + +
+ + +
+ + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090302.xhp b/helpcontent2/source/text/sbasic/shared/03090302.xhp new file mode 100644 index 000000000..720aa3fdc --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090302.xhp @@ -0,0 +1,71 @@ + + + + + + + + + GoTo Statement + /text/sbasic/shared/03090302.xhp + + + Sun Microsystems, Inc. + + + + +
+ + GoTo statement + label; in GoTo statement + +GoTo Statement + Continues program execution within a Sub or Function at the procedure line indicated by a label. +
+Syntax: + +GoTo label[:] + + +Parameters: +label: A line identifier indicating where to continue execution. The scope of a label in that of the routine it belongs to. + Use the GoTo statement to instruct $[officename] Basic to continue program execution at another place within the procedure. The position must be indicated by a label. To set a label, assign a name, and then and end it with a colon (":"). + You cannot use the GoTo statement to jump out of a Sub or Function. +Example: + + Sub/Function + ' statement block + GoTo Label1 + Label2: + ' statement block + Exit Sub/Function + Label1: + ' statement block + GoTo Label2 + End Sub/Function + + +
+ + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090303.xhp b/helpcontent2/source/text/sbasic/shared/03090303.xhp new file mode 100644 index 000000000..cad7a574f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090303.xhp @@ -0,0 +1,84 @@ + + + + + + + On...GoSub Statement; On...GoTo Statement + /text/sbasic/shared/03090303.xhp + + + + + +
+ + On...GoSub statement + On...GoTo statement + label; in On...GoSub statement + label; in On...GoTo statement + + + +

On...GoSub Statement; On...GoTo Statement

+Branches to one of several specified lines in the program code, depending on the value of a numeric expression. +
+ + +On GoSub/GoTo syntax + +On expression GoSub Label1[, Label2[, Label3[,...]]] +On expression GoTo Label1[, Label2[, Label3[,...]]] + + + + expression: Any numeric expression between 0 and 255 that determines which of the lines the program branches to. If expression is 0, the statement is not executed. If expression is greater than 0, the program jumps to the label that has a position number that corresponds to the expression (1 = First label; 2 = Second label) + label: Target line according to GoTo or GoSub structure. +The GoTo or GoSub conventions are valid. + + + +Sub ExampleOnGosub +Dim iVar As Integer +Dim sVar As String + iVar = 2 + sVar ="" + On iVar GoSub Sub1, Sub2 + On iVar GoTo Line1, Line2 + Exit Sub +Sub1: + sVar =sVar & " From Sub 1 to" : Return +Sub2: + sVar =sVar & " From Sub 2 to" : Return +Line1: + sVar =sVar & " Label 1" : GoTo Ende +Line2: + sVar =sVar & " Label 2" +Ende: + MsgBox sVar,0,"On...GoSub" +End Sub + + +
+ + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090400.xhp b/helpcontent2/source/text/sbasic/shared/03090400.xhp new file mode 100644 index 000000000..f86cfeb44 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090400.xhp @@ -0,0 +1,50 @@ + + + + + + + + +Further Statements +/text/sbasic/shared/03090400.xhp + + +Sun Microsystems, Inc. + + + +
+ Further Statements + Statements that do not belong to any of the other categories are described here. +
+ + + + + + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090401.xhp b/helpcontent2/source/text/sbasic/shared/03090401.xhp new file mode 100644 index 000000000..662580d96 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090401.xhp @@ -0,0 +1,64 @@ + + + + + +Call Statement +/text/sbasic/shared/03090401.xhp + + +Sun Microsystems, Inc. + + + +
+Call statement + +Call Statement +Transfers the control of the program to a subroutine, a function, or a procedure of a Dynamic Link Library (DLL). The keyword, type and number of parameters is dependent on the routine that is being called. +
+Syntax: + + Call Statement diagram + +[Call] name [(] [param :=] value, ... [)] + +Parameters: + +name: Name of the subroutine, the function, or the DLL that you want to call + +param: Keyword parameter name to pass to the routine, followed by its value. The name must match the routine declaration. Keywords are optional and can be used in any order. +value: Positional parameter value. The type is dependent on the routine that is being called +When mixing positional and keyword parameters, make sure positional parameters are following the routine declaration order. +When a function is used as an expression, enclosing parameters with brackets becomes necessary. Using a Declare statement is compulsory prior to call a DLL. +Example: + +Sub ExampleCall + Dim value As String + value = "LibreOffice" + Call aRoutine value + aRoutine text := value +End Sub + +Sub aRoutine (text as String) + Msgbox text +End Sub + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090402.xhp b/helpcontent2/source/text/sbasic/shared/03090402.xhp new file mode 100644 index 000000000..1abbfa6ea --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090402.xhp @@ -0,0 +1,69 @@ + + + + + + + Choose Function + /text/sbasic/shared/03090402.xhp + + + + + + +
+ + Choose function + + + +Choose Function +Returns a selected value from a list of arguments. +
+ +Syntax: + +Choose (Index, Selection1[, Selection2, ... [,Selection_n]]) + + +Parameters: + Index: A numeric expression that specifies the value to return. + Selection1: Any expression that contains one of the possible choices. +The Choose function returns a value from the list of expressions based on the index value. If Index = 1, the function returns the first expression in the list, if index i= 2, it returns the second expression, and so on. +If the index value is less than 1 or greater than the number of expressions listed, the function returns a Null value. +The following example uses the Choose function to select a string from several strings that form a menu: + + + +Example: + +Sub ExampleChoose +Dim sReturn As String + sReturn = ChooseMenu(2) + Print sReturn +End Sub + +Function ChooseMenu(Index As Integer) + ChooseMenu = Choose(Index, "Quick Format", "Save Format", "System Format") +End Function + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090403.xhp b/helpcontent2/source/text/sbasic/shared/03090403.xhp new file mode 100644 index 000000000..2a4b3d519 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090403.xhp @@ -0,0 +1,71 @@ + + + + + + + Declare Statement + /text/sbasic/shared/03090403.xhp + + + + + + +
+ + Declare statement + + + +Declare Statement + + DLL (Dynamic Link Library) + + +Declares and defines a subroutine in a DLL file that you want to execute from $[officename] Basic. +
+See also: FreeLibrary + +Syntax: + +Declare {Sub | Function} Name Lib "Libname" [Alias "Aliasname"] [Parameter] [As Type] + + +Parameters: + Name: A different name than defined in the DLL, to call the subroutine from $[officename] Basic. + Aliasname: Name of the subroutine as defined in the DLL. + Libname: File or system name of the DLL. This library is automatically loaded the first time the function is used. + Argumentlist: List of parameters representing arguments that are passed to the procedure when it is called. The type and number of parameters is dependent on the executed procedure. + Type: Defines the data type of the value that is returned by a function procedure. You can exclude this parameter if a type-declaration character is entered after the name. +To pass a parameter to a subroutine as a value instead of as a reference, the parameter must be indicated by the keyword ByVal. + +Example: + +Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( Long ) +Sub ExampleDeclare +Dim lValue As Long + lValue = 5000 + MyMessageBeep( lValue ) + FreeLibrary("user32.dll" ) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090404.xhp b/helpcontent2/source/text/sbasic/shared/03090404.xhp new file mode 100644 index 000000000..ada8a37a8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090404.xhp @@ -0,0 +1,77 @@ + + + + + + + End Statement + /text/sbasic/shared/03090404.xhp + + + + + + +
+ + End statement + + + +End Statement +Ends a procedure or block. +
+ +Syntax: + +End, End Enum, End Function, End If, End Property, End Select, End Sub, End With + + +Parameters: +Use the End statement as follows: + +Statement +End: Is not required, but can be entered anywhere within a procedure to end the program execution. +End Enum: Ends an Enum VBA statement +End Function: Ends a Function statement. +End If: Marks the end of a If...Then...Else block. +End Property: Marks the end of a Property statement. +End Select: Marks the end of a Select Case block. +End Sub: Ends a Sub statement. +End With: Ends a With statement + +Example: + +Sub ExampleRandomSelect +Dim iVar As Integer + iVar = Int((15 * Rnd) -2) + Select Case iVar + Case 1 To 5 + Print "Number from 1 to 5" + Case 6, 7, 8 + Print "Number from 6 to 8" + Case Is > 8 And iVar < 11 + Print "Greater than 8" + Case Else + Print "Outside range 1 to 10" + End Select +End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090405.xhp b/helpcontent2/source/text/sbasic/shared/03090405.xhp new file mode 100644 index 000000000..7297dd934 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090405.xhp @@ -0,0 +1,64 @@ + + + + + + + FreeLibrary Function + /text/sbasic/shared/03090405.xhp + + + + + + +
+ + FreeLibrary function + + + +FreeLibrary Function +Releases DLLs that were loaded by a Declare statement. A released DLL is automatically reloaded if one of its functions is called. See also: Declare +
+ +Syntax: + +FreeLibrary (LibName As String) + + +Parameters: + LibName: String expression that specifies the name of the DLL. +FreeLibrary can only release DLLs that are loaded during Basic runtime. + + + +Example: + +Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( Long ) +Sub ExampleDeclare +Dim lValue As Long + lValue = 5000 + MyMessageBeep( lValue ) + FreeLibrary("user32.dll" ) +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090406.xhp b/helpcontent2/source/text/sbasic/shared/03090406.xhp new file mode 100644 index 000000000..eb10a54c3 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090406.xhp @@ -0,0 +1,98 @@ + + + + + + + Function Statement + /text/sbasic/shared/03090406.xhp + + + + + +
+ + Function statement + + +Function Statement +Defines a subroutine that can be used as an expression to determine a return type. +
+ +
+Sub or Function statements are similar methods, without distinction. They receive parameters by reference allowing them to be modified. %PRODUCTNAME Basic compiler accepts their respective syntax to be used interchangeably. +
+ + + + Function Statement diagram + + [Private | Public] Function Name[char] (argument1 [As Type][, argument2[char][,...]]) [As typename] + statements + [Exit Function] + statements + End Function + + + +
+ scope: Function default scope is Public. A Private scope denotes a module internal routine, not intended to be used from other modules. +
+ + name: Name of the subroutine to contain the value returned by the function. + arguments: Parameters to be passed to the subroutine. + + + + + +
+

Examples:

+ +Sub ExampleExit +Dim sReturn As String +Dim sListArray(10) As String +Dim siStep As Single + For siStep = 0 To 10 ' Fill array with test data + sListArray(siStep) = chr$(siStep + 65) + MsgBox sListArray(siStep) + Next siStep + sReturn = LinSearch(sListArray(), "B") + Print sReturn +End Sub + +Function LinSearch( sList(), sItem As String ) As Integer +Dim iCount As Integer +' Linsearch searches a TextArray:sList() for a TextEntry: +' Return value Is the index of the entry Or 0 (Null) + For iCount=1 To Ubound( sList() ) + If sList( iCount ) = sItem Then + Exit For ' sItem found + End If + Next iCount + If iCount = Ubound( sList() ) Then iCount = 0 + LinSearch = iCount +End Function + +
+ + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090407.xhp b/helpcontent2/source/text/sbasic/shared/03090407.xhp new file mode 100644 index 000000000..360c6fbdd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090407.xhp @@ -0,0 +1,61 @@ + + + + + + + Rem Statement + /text/sbasic/shared/03090407.xhp + + + + + + +
+ + Rem statement + comments;Rem statement + + + +

Rem Statement

+Specifies that a program line is a comment. +
+ + +Rem Text + + + Text: Any text that serves as a comment. +You can use the single quotation mark instead of the Rem keyword to indicate that the text on a line is comments. This symbol can be inserted directly to the right of the program code, followed by a comment. +You can use a space followed by the underline character _ as the last two characters of a line to continue the logical line on the next line. To continue comment lines, you must enter "Option Compatible" in the same Basic module. + + + +Sub ExampleMid +Dim sVar As String + sVar = "Las Vegas" + Print Mid(sVar,3,5) ' Returns "s Veg" + ' Nothing occurs here +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090408.xhp b/helpcontent2/source/text/sbasic/shared/03090408.xhp new file mode 100644 index 000000000..d78fa9df0 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090408.xhp @@ -0,0 +1,55 @@ + + + + + + + Stop Statement + /text/sbasic/shared/03090408.xhp + + + + + +
+ + Stop statement + + +Stop Statement +Stops the execution of the Basic program. +
+ +Syntax: + +Stop + + +Example: + +Sub ExampleStop +Dim iVar As Single + iVar = 36 + Stop + MsgBox Sqr(iVar) +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03090409.xhp b/helpcontent2/source/text/sbasic/shared/03090409.xhp new file mode 100644 index 000000000..9dbe58789 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090409.xhp @@ -0,0 +1,64 @@ + + + + + + + Sub Statement + /text/sbasic/shared/03090409.xhp + + + + + +
+ + Sub statement + + +Sub Statement +Defines a subroutine. +
+ + + + + Sub Statement diagram + + +[Private | Public] Sub name[(argument1 [As typename][, argument2[char][,...]])] + ' statements + [Exit Sub] + ' statements +End Sub + + + + name: Name of the subroutine. + arguments: Optional parameters that you want to pass to the subroutine. + + + + + + + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090410.xhp b/helpcontent2/source/text/sbasic/shared/03090410.xhp new file mode 100644 index 000000000..dc751a7e8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090410.xhp @@ -0,0 +1,68 @@ + + + + + + + Switch Function + /text/sbasic/shared/03090410.xhp + + + + + + +
+ + Switch function + + + +Switch Function +Evaluates a list of arguments, consisting of an expression followed by a value. The Switch function returns a value that is associated with the expression that is passed by this function. +
+ +Syntax: + +Switch (Expression1, Value1[, Expression2, Value2[..., Expression_n, Value_n]]) + + +Parameters: +The Switch function evaluates the expressions from left to right, and then returns the value that is assigned to the function expression. If expression and value are not given as a pair, a runtime error occurs. + Expression: The expression that you want to evaluate. + Value: The value that you want to return if the expression is True. +In the following example, the Switch function assigns the appropriate gender to the name that is passed to the function: + + + +Example: + +Sub ExampleSwitch +Dim sGender As String + sGender = GetGenderIndex( "John" ) + MsgBox sGender +End Sub + +Function GetGenderIndex (sName As String) As String + GetGenderIndex = Switch(sName = "Jane", "female", sName = "John", "male") +End Function + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090411.xhp b/helpcontent2/source/text/sbasic/shared/03090411.xhp new file mode 100644 index 000000000..5d4c41596 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090411.xhp @@ -0,0 +1,48 @@ + + + + + + + +With Statement +/text/sbasic/shared/03090411.xhp + + +Sun Microsystems, Inc. + + + +
+With statement + +With Statement +Sets an object as the default object. Unless another object name is declared, all properties and methods refer to the default object until the End With statement is reached. +
+Syntax: + + With Object + Statement block + End With + +Parameters: +Use With and End With if you have several properties or methods for a single object. + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03090412.xhp b/helpcontent2/source/text/sbasic/shared/03090412.xhp new file mode 100644 index 000000000..adad55212 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090412.xhp @@ -0,0 +1,87 @@ + + + + + + + Exit Statement + /text/sbasic/shared/03090412.xhp + + + + + + +
+ + Exit statement + + + +

Exit Statement

+Exits a Do...Loop, For...Next, a function, a property, or a subroutine. +
+ + + +Exit Do, Exit For, Exit Function, Exit Property, Exit Sub + + + + Exit Do +Only valid within a Do...Loop statement to exit the loop. Program execution continues with the statement that follows the Loop statement. If Do...Loop statements are nested, the control is transferred to the loop in the next higher level. + Exit For +Only valid within a For...Next loop to exit the loop. Program execution continues with the first statement that follows the Next statement. In nested statements, the control is transferred to the loop in the next higher level. + Exit Function +Exits the Function procedure immediately. Program execution continues with the statement that follows the Function call. + Exit Property +Exits the Property procedure immediately. Program execution continues with the statement that follows the Property call. + Exit Sub +Exits the subroutine immediately. Program execution continues with the statement that follows the Sub call. +The Exit statement does not define the end of a structure, and must not be confused with the End statement. + + + +Sub ExampleExit +Dim sReturn As String +Dim sListArray(10) As String +Dim siStep As Single + For siStep = 0 To 10 ' Fill array with test data + sListArray(siStep) = chr(siStep + 65) + MsgBox sListArray(siStep) + Next siStep + sReturn = LinSearch(sListArray(), "B") + Print sReturn +End Sub + +Function LinSearch( sList(), sItem As String ) As Integer +Dim iCount As Integer +' LinSearch searches a TextArray:sList() for a TextEntry: +' Returns the index of the entry or 0 (Null) + For iCount=1 To Ubound( sList() ) + If sList( iCount ) = sItem Then + Exit For ' sItem found + End If + Next iCount + If iCount = Ubound( sList() ) Then iCount = 0 + LinSearch = iCount +End Function + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03090413.xhp b/helpcontent2/source/text/sbasic/shared/03090413.xhp new file mode 100644 index 000000000..e7c2329ea --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090413.xhp @@ -0,0 +1,69 @@ + + + + + + + + Type Statement + /text/sbasic/shared/03090413.xhp + + + +
+ + Type statement + + Type Statement + Define non-UNO data structures. +
+ A Type structure is an ordered collection of data fields, that can be manipulated as a single item. + + Type statement diagram + + Type struct_name + DataField1 As TypeName1 + DataField2 As TypeName2 + (...) + End Type ' struct_name + + + + Extended types such as Type statement structures, UNO objects or ClassModule objects are valid typenames. + + A Type structure scope is that of the module it belongs to. + + + Type Customer + Name1 As String + City As String + End Type ' Customer structure + Sub setCustomer + Dim oCustomer as New Customer + oCustomer.Name1 = "The Document Foundation" + oCustomer.City = "Berlin" + End Sub + + Enumerations can be created using Type statement definitions. Calling Python Scripts from Basic illustrates that mechanism. +
+ + CreateObject function +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03100000.xhp b/helpcontent2/source/text/sbasic/shared/03100000.xhp new file mode 100644 index 000000000..1c7419748 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100000.xhp @@ -0,0 +1,91 @@ + + + + + + + + +Variables +/text/sbasic/shared/03100000.xhp + + +Sun Microsystems, Inc. + + + +
+Variables +The following statements and functions are for working with variables. You can use these functions to declare or define variables, convert variables from one type to another, or determine the variable type. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03100050.xhp b/helpcontent2/source/text/sbasic/shared/03100050.xhp new file mode 100644 index 000000000..bd4a2b239 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100050.xhp @@ -0,0 +1,48 @@ + + + + + + + +CCur Function +/text/sbasic/shared/03100050.xhp + + +CCur + + + +
+CCur function + +CCur Function +Converts a string expression or numeric expression to a currency expression. The locale settings are used for decimal separators and currency symbols. +
+Syntax: + +CCur(Expression) + +Return value: +Currency +Parameter: +Expression: Any string or numeric expression that you want to convert. + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03100060.xhp b/helpcontent2/source/text/sbasic/shared/03100060.xhp new file mode 100644 index 000000000..f25a39b2a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100060.xhp @@ -0,0 +1,48 @@ + + + + + + + +CDec Function +/text/sbasic/shared/03100060.xhp + + +CDec + + + +
+CDec function + +CDec Function +Converts a string expression or numeric expression to a decimal expression. +
+Syntax: + +CDec(Expression) + +Return value: +Decimal number. +Parameter: +Expression: Any string or numeric expression that you want to convert. + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03100070.xhp b/helpcontent2/source/text/sbasic/shared/03100070.xhp new file mode 100644 index 000000000..840a6eb66 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100070.xhp @@ -0,0 +1,48 @@ + + + + + + + +CVar Function +/text/sbasic/shared/03100070.xhp + + +CVar + + + +
+CVar function + +CVar Function +Converts a string expression or numeric expression to a variant expression. +
+Syntax: + +CVar(Expression) + +Return value: +Variant. +Parameter: +Expression: Any string or numeric expression that you want to convert. + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03100080.xhp b/helpcontent2/source/text/sbasic/shared/03100080.xhp new file mode 100644 index 000000000..3107ba049 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100080.xhp @@ -0,0 +1,50 @@ + + + + + + + + CVErr Function + /text/sbasic/shared/03100080.xhp + + + CVErr + + + +
+ CVErr function + +

CVErr Function

+ Converts a string expression or numeric expression to a variant expression of the sub type "Error". +
+

Syntax:

+ + CVErr(Expression) + +

Return value:

+ Variant. +

Parameter:

+ Expression: Any string or numeric expression that you want to convert. +
+ +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03100100.xhp b/helpcontent2/source/text/sbasic/shared/03100100.xhp new file mode 100644 index 000000000..e8f2b9ece --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100100.xhp @@ -0,0 +1,72 @@ + + + + + + + CBool Function + /text/sbasic/shared/03100100.xhp + + + + + + +
+ + CBool function + + + +CBool Function +Converts a string comparison or numeric comparison to a Boolean expression, or converts a single numeric expression to a Boolean expression. +
+ +Syntax: + +CBool (Expression1 {= | <> | < | > | <= | >=} Expression2) or CBool (Number) + + +Return value: +Bool + +Parameters: + Expression1, Expression2: Any string or numeric expressions that you want to compare. If the expressions match, the CBool function returns True, otherwise False is returned. + Number: Any numeric expression that you want to convert. If the expression equals 0, False is returned, otherwise True is returned. +The following example uses the CBool function to evaluate the value that is returned by the Instr function. The function checks if the word "and" is found in the sentence that was entered by the user. + + + +Example: + +Sub ExampleCBool +Dim sText As String + sText = InputBox("Please enter a short sentence:") + ' Proof if the word »and« appears in the sentence. + ' Instead of the command line + ' If Instr(Input, "and")<>0 Then... + ' the CBool function is applied as follows: + If CBool(Instr(sText, "and")) Then + MsgBox "The word »and« appears in the sentence you entered!" + EndIf +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03100300.xhp b/helpcontent2/source/text/sbasic/shared/03100300.xhp new file mode 100644 index 000000000..e59c89351 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100300.xhp @@ -0,0 +1,64 @@ + + + + + + + CDate Function + /text/sbasic/shared/03100300.xhp + + + + + + +
+ + CDate function + + + +CDate Function +Converts any string or numeric expression to a date value. +
+ +Syntax: + +CDate (Expression) + + +Return value: +Date + +Parameters: + Expression: Any string or numeric expression that you want to convert. +When you convert a string expression, the date and time must be entered either in one of the date acceptance patterns defined for your locale setting (see %PRODUCTNAME - PreferencesTools - Options - Language Settings - Languages) or in ISO date format (momentarily, only the ISO format with hyphens, e.g. "2012-12-31" is accepted). In numeric expressions, values to the left of the decimal represent the date, beginning from December 31, 1899. Values to the right of the decimal represent the time. + + + +Example: + +Sub ExampleCDate + MsgBox cDate(1000.25) ' 09.26.1902 06:00:00 + MsgBox cDate(1001.26) ' 09.27.1902 06:14:24 +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03100400.xhp b/helpcontent2/source/text/sbasic/shared/03100400.xhp new file mode 100644 index 000000000..1913b3afb --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100400.xhp @@ -0,0 +1,64 @@ + + + + + + + CDbl Function + /text/sbasic/shared/03100400.xhp + + + + + +
+ + CDbl function + + +CDbl Function +Converts any numerical expression or string expression to a double type. +
+ +Syntax + +CDbl (Expression) + + +Return value +Double + +Parameters: + Expression: Any string or numeric expression that you want to convert. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. + + + +
+Example: + +Sub ExampleCountryConvert + MsgBox CDbl(1234.5678) + MsgBox CInt(1234.5678) + MsgBox CLng(1234.5678) +End Sub + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03100500.xhp b/helpcontent2/source/text/sbasic/shared/03100500.xhp new file mode 100644 index 000000000..1727fe940 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100500.xhp @@ -0,0 +1,56 @@ + + + + + + + CInt Function + /text/sbasic/shared/03100500.xhp + + + + + +
+ + CInt function + + +CInt Function +Converts any string or numeric expression to an integer. +
+ +Syntax: + +CInt (Expression) + + +Return value: +Integer + +Parameters: + Expression: Any numeric expression that you want to convert. If the Expression exceeds the value range between -32768 and 32767, $[officename] Basic reports an overflow error. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. +This function always rounds the fractional part of a number to the nearest integer. + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03100600.xhp b/helpcontent2/source/text/sbasic/shared/03100600.xhp new file mode 100644 index 000000000..bc5b1dc68 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100600.xhp @@ -0,0 +1,56 @@ + + + + + + + CLng Function + /text/sbasic/shared/03100600.xhp + + + + + +
+ + CLng function + + +CLng Function +Converts any string or numeric expression to a long integer. +
+ +Syntax: + +CLng (Expression) + + +Return value: +Long + +Parameters: + Expression: Any numerical expression that you want to convert. If the Expression lies outside the valid long integer range between -2.147.483.648 and 2.147.483.647, $[officename] Basic returns an overflow error. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. +This function always rounds the fractional part of a number to the nearest integer. + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03100700.xhp b/helpcontent2/source/text/sbasic/shared/03100700.xhp new file mode 100644 index 000000000..f1c12c480 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100700.xhp @@ -0,0 +1,61 @@ + + + + + + + Const Statement + /text/sbasic/shared/03100700.xhp + + + + + +
+ + Const statement + + +Const Statement +Defines a string as a constant. +
+ +Syntax: + +Const Text = Expression + + +Parameters: + Text: Any constant name that follows the standard variable naming conventions. +A constant is a variable that helps to improve the readability of a program. Constants are not defined as a specific type of variable, but rather are used as placeholders in the code. You can only define a constant once and it cannot be modified. Use the following statement to define a constant: +CONST ConstName=Expression +The type of expression is irrelevant. If a program is started, $[officename] Basic converts the program code internally so that each time a constant is used, the defined expression replaces it. + +Example: + +Sub ExampleConst + Const iVar = 1964 + MsgBox iVar + Const sVar = "Program", dVar As Double = 1.00 + MsgBox sVar & " " & dVar +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03100900.xhp b/helpcontent2/source/text/sbasic/shared/03100900.xhp new file mode 100644 index 000000000..0ae154f02 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03100900.xhp @@ -0,0 +1,65 @@ + + + + + + + CSng Function + /text/sbasic/shared/03100900.xhp + + + + + + +
+ + CSng function + + + +CSng Function +Converts any string or numeric expression to data type Single. +
+ +Syntax: + +CSng (Expression) + + +Return value: +Single + +Parameters: + Expression: Any string or numeric expression that you want to convert. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. + + + +Example: + +Sub ExampleCSNG + MsgBox CDbl(1234.5678) + MsgBox CInt(1234.5678) + MsgBox CLng(1234.5678) + MsgBox CSng(1234.5678) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03101000.xhp b/helpcontent2/source/text/sbasic/shared/03101000.xhp new file mode 100644 index 000000000..8ec92a79a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101000.xhp @@ -0,0 +1,115 @@ + + + + + + + CStr Function + /text/sbasic/shared/03101000.xhp + + + + + + +
+ + CStr function + + + +CStr Function +Converts any numeric expression to a string expression. +
+ +Syntax: + +CStr (Expression) + + +Return value: +String + +Parameters: + Expression: Any valid string or numeric expression that you want to convert. + +Expression Types and Conversion Returns + + + + + Boolean : + + + String that evaluates to either True or False. + + + + + Date : + + + String that contains the date and time. + + + + + Null : + + + Run-time error. + + + + + Empty : + + + String without any characters. + + + + + Any : + + + Corresponding number as string. + + +
+ +Zeros at the end of a floating-point number are not included in the returned string. + + + +Example: + +Sub ExampleCSTR +Dim sVar As String + MsgBox CDbl(1234.5678) + MsgBox CInt(1234.5678) + MsgBox CLng(1234.5678) + MsgBox CSng(1234.5678) + sVar = CStr(1234.5678) + MsgBox sVar +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03101100.xhp b/helpcontent2/source/text/sbasic/shared/03101100.xhp new file mode 100644 index 000000000..e8b996221 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101100.xhp @@ -0,0 +1,72 @@ + + + + + + + DefBool Statement + /text/sbasic/shared/03101100.xhp + + + + + +
+ + DefBool statement + + +DefBool Statement +If no type-declaration character or keyword is specified, the DefBool statement sets the default data type for variables, according to a letter range. +
+ +
+Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] + + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set the default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type +
+ DefBool: Boolean + +
+Example: + +' Prefix definition for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v + +
+ +Sub ExampleDefBool + bOK=TRUE ' bOK is an implicit boolean variable +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03101110.xhp b/helpcontent2/source/text/sbasic/shared/03101110.xhp new file mode 100644 index 000000000..811225a30 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101110.xhp @@ -0,0 +1,51 @@ + + + + + + + +DefCur Statement +/text/sbasic/shared/03101110.xhp + + +DefCurr + + + +
+DefCur statement + +DefCur Statement +If no type-declaration character or keyword is specified, the DefCur statement sets the default variable type, according to a letter range. +
+ + + +DefCur: Currency + + + +DefCur c +Sub ExampleDefCur + cCur=Currency ' cCur is an implicit currency variable. +End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03101120.xhp b/helpcontent2/source/text/sbasic/shared/03101120.xhp new file mode 100644 index 000000000..7bdb551bb --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101120.xhp @@ -0,0 +1,51 @@ + + + + + + + DefErr Statement + /text/sbasic/shared/03101120.xhp + + + + + +
+ + DefErr statement + + +DefErr Statement +If no type-declaration character or keyword is specified, the DefErr statement sets the default variable type, according to a letter range. +
+ + + DefErr: Error + + + +DefErr e +Sub ExampleDefErr + eErr=Error ' eErr is an implicit error variable +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03101130.xhp b/helpcontent2/source/text/sbasic/shared/03101130.xhp new file mode 100644 index 000000000..24b4deb94 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101130.xhp @@ -0,0 +1,51 @@ + + + + + + + DefSng Statement + /text/sbasic/shared/03101130.xhp + + + + + +
+ + DefSng statement + + +DefSng Statement +If no type-declaration character or keyword is specified, the DefSng statement sets the default variable type, according to a letter range. +
+ + + DefSng: Single + + + +DefSng s +Sub ExampleDefSng + sSng=Single ' sSng is an implicit single variable +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03101140.xhp b/helpcontent2/source/text/sbasic/shared/03101140.xhp new file mode 100644 index 000000000..f9847edbd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101140.xhp @@ -0,0 +1,51 @@ + + + + + + + DefStr Statement + /text/sbasic/shared/03101140.xhp + + + + + +
+ + DefStr statement + + +DefStr Statement +If no type-declaration character or keyword is specified, the DefStr statement sets the default variable type, according to a letter range. +
+ + + DefStr: String + + + +DefStr s +Sub ExampleDefStr + sStr=String ' sStr is an implicit string variable +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03101300.xhp b/helpcontent2/source/text/sbasic/shared/03101300.xhp new file mode 100644 index 000000000..8dec758eb --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101300.xhp @@ -0,0 +1,50 @@ + + + + + + + DefDate Statement + /text/sbasic/shared/03101300.xhp + + + + + +
+ + DefDate statement + + +DefDate Statement +If no type-declaration character or keyword is specified, the DefDate statement sets the default variable type, according to a letter range. +
+ + + DefDate: Date + + + +Sub ExampleDefDate + tDate=Date ' tDate is an implicit date variable +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03101400.xhp b/helpcontent2/source/text/sbasic/shared/03101400.xhp new file mode 100644 index 000000000..1522dd01b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101400.xhp @@ -0,0 +1,50 @@ + + + + + + + DefDbl Statement + /text/sbasic/shared/03101400.xhp + + + + + +
+ + DefDbl statement + + +DefDbl Statement +Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified. +
+ + + DefDbl: Double + + + +Sub ExampleDefDBL + dValue=1.23e43 ' dValue is an implicit double variable type +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03101500.xhp b/helpcontent2/source/text/sbasic/shared/03101500.xhp new file mode 100644 index 000000000..96e1cc57a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101500.xhp @@ -0,0 +1,50 @@ + + + + + + + DefInt Statement + /text/sbasic/shared/03101500.xhp + + + + + +
+ + DefInt statement + + +DefInt Statement +Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified. +
+ + + DefInt: Integer + + + +Sub ExampleDefInt + iCount=200 ' iCount is an implicit integer variable +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03101600.xhp b/helpcontent2/source/text/sbasic/shared/03101600.xhp new file mode 100644 index 000000000..c354d1638 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101600.xhp @@ -0,0 +1,50 @@ + + + + + + + DefLng Statement + /text/sbasic/shared/03101600.xhp + + + + + +
+ + DefLng statement + + +DefLng Statement +Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified. +
+ + + DefLng: Long + + + +Sub ExampleDefLng + lCount=123456789 ' lCount is an implicit long integer variable +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03101700.xhp b/helpcontent2/source/text/sbasic/shared/03101700.xhp new file mode 100644 index 000000000..42b09fc9f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03101700.xhp @@ -0,0 +1,45 @@ + + + + + + + +DefObj Statement +/text/sbasic/shared/03101700.xhp + + +Sun Microsystems, Inc. + + + +
+DefObj statement + +DefObj Statement +Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified. +
+ + + +DefObj: Object + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03102000.xhp b/helpcontent2/source/text/sbasic/shared/03102000.xhp new file mode 100644 index 000000000..767a31950 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102000.xhp @@ -0,0 +1,69 @@ + + + + + + + DefVar Statement + /text/sbasic/shared/03102000.xhp + + + + + + +
+ + DefVar statement + + + +DefVar Statement +Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified. +
+ +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] + + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set the default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefVar: Variant + +Example: + +' Prefix definitions for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +Sub ExampleDefVar + vDiv=99 ' vDiv is an implicit variant + vDiv="Hello world" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03102100.xhp b/helpcontent2/source/text/sbasic/shared/03102100.xhp new file mode 100644 index 000000000..7fc1e496f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102100.xhp @@ -0,0 +1,158 @@ + + + + + + + Dim Statement + /text/sbasic/shared/03102100.xhp + + + + + +
+ + Dim statement + arrays; dimensioning + dimensioning arrays + + +

Dim Statement

+Declares variables or arrays. +
+ +If the variables are separated by commas - for example Dim v1, v2, v3 As String - first ones get defined as Variant variables. A new line, or colon sign (:), help separate variable definitions. + + Dim text As String + Dim pv As com.sun.star.beans.PropertyValue, d As Date + Dim Units as Integer : Dim EULER As Double + +Dim declares local variables within subroutines. Global variables are declared with the Global, Public or the Private statement. + + + + Dim Statement diagram + + +Dim variable [(start To end)] [As typename][, variable2[char] [(start To end)] [,...]] + + +
+ + variable: Any variable or array name. + + typename: Keyword that declares the data type of a variable. + + primitive data types fragment + + Byte: Byte variable (0-255) + Boolean: Boolean variable (True, False) + Currency: Currency variable (Currency with 4 Decimal places) + Date: Date variable + Double: Double-precision floating-point variable (1,79769313486232 x 10E308 - 4,94065645841247 x 10E-324) + Integer: Integer variable (-32768 - 32767) + Long: Long integer variable (-2.147.483.648 - 2.147.483.647) + Object: Object variable (Note: this variable can only subsequently be defined with Set!) + Single: Single-precision floating-point variable (3,402823 x 10E38 - 1,401298 x 10E-45). + String: String variable consisting of a maximum of 64,000 ASCII characters. + Variant: Variant variable type (contains all types, specified by definition). If a type name is not specified, variables are automatically defined as Variant Type, unless a statement from DefBool to DefVar is used. + object: Universal Network object (UNO) object or ClassModule object instance. + +char: Special character that declares the data type of a variable. + Type declaration characters fragment + +In %PRODUCTNAME Basic, you do not need to declare variables explicitly. However, you need to declare arrays before you can use them. You can declare a variable with the Dim statement, using commas (,) to separate multiple declarations. To declare a variable type, enter a type-declaration character following the name or use a corresponding type keyword name. + + + Declaration character + Variable type name + + + % + Integer + + + & + Long + + + ! + Single + + + # + Double + + + $ + String + + + @ + Currency + +
+ + array: Array declaration. + + array fragment + + start, end: Numerical values or constants that define the number of elements (NumberElements=(end-start)+1) and the index range.see #i36558 + start and end can be numerical expressions if ReDim is applied at the procedure level. +$[officename] Basic supports single or multi-dimensional arrays that are defined by a specified variable type. Arrays are suitable if the program contains lists or tables that you want to edit. The advantage of arrays is that it is possible to address individual elements according to indexes, which can be formulated as numeric expressions or variables. + Arrays are declared with the Dim statement. There are multiple ways to define the index range: + + Dim text(20) As String ' 21 elements numbered from 0 to 20 + Dim value(5 to 25) As Integer ' 21 values numbered from 5 to 25 + Dim amount(-15 to 5) As Currency ' 21 amounts (including 0), numbered from -15 to 5 + REM Two-dimensional data field + Dim table$(20,2) ' 63 items; from 0 to 20 level 1, from 0 to 20 level 2 and from 0 to 20 level 3. + + +You can declare an array types as dynamic if a ReDim statement defines the number of dimensions in the subroutine or the function that contains the array. Generally, you can only define an array dimension once, and you cannot modify it. Within a subroutine, you can declare an array with ReDim. You can only define dimensions with numeric expressions. This ensures that the fields are only as large as necessary. +
+ + + +Sub ExampleDim1 +Dim sVar As String +Dim iVar As Integer + sVar = "Office" +End Sub + +Sub ExampleDim2 + ' Two-dimensional data field + Dim stext(20,2) As String + Const sDim As String = " Dimension:" + For i = 0 To 20 + For ii = 0 To 2 + stext(i,ii) = str(i) & sDim & str(ii) + Next ii + Next i + For i = 0 To 20 + For ii = 0 To 2 + MsgBox stext(i,ii) + Next ii + Next i +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03102101.xhp b/helpcontent2/source/text/sbasic/shared/03102101.xhp new file mode 100644 index 000000000..8c71168a4 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102101.xhp @@ -0,0 +1,67 @@ + + + + + + + ReDim Statement + /text/sbasic/shared/03102101.xhp + + + + + + +
+ + ReDim statement + + +

ReDim Statement

+Declares or redefines variables or arrays. +
+ + + + ReDim Statement diagram + + +ReDim [Preserve] variable [(start To end)] [As type-name][, variable2 [(start To end)] [As type-name][,...]] + +Optionally, add the Preserve keyword to preserve the contents of the array that is redimensioned. ReDim can only be used in subroutines. + + + +Example: + +Sub ExampleRedim + Dim iVar() As Integer, iCount As Byte + ReDim iVar(5) As Integer + For iCount = 1 To 5 + iVar(iCount) = iCount + Next iCount + ReDim iVar(10) As Integer + For iCount = 1 To 10 + iVar(iCount) = iCount + Next iCount +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03102200.xhp b/helpcontent2/source/text/sbasic/shared/03102200.xhp new file mode 100644 index 000000000..35011fce2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102200.xhp @@ -0,0 +1,63 @@ + + + + + + + IsArray Function + /text/sbasic/shared/03102200.xhp + + + + + + +
+ + IsArray function + + + +IsArray Function +Determines if a variable is a data field in an array. +
+ +Syntax: + +IsArray (Var) + + +Return value: +Bool + +Parameters: + Var: Any variable that you want to test if it is declared as an array. If the variable is an array, then the function returns True, otherwise False is returned. + + + +Example: + +Sub ExampleIsArray +Dim sDatf(10) As String + Print isarray(sdatf()) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03102300.xhp b/helpcontent2/source/text/sbasic/shared/03102300.xhp new file mode 100644 index 000000000..765ecb8ca --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102300.xhp @@ -0,0 +1,66 @@ + + + + + + + IsDate Function + /text/sbasic/shared/03102300.xhp + + + + + + +
+ + IsDate function + + + +IsDate Function +Tests if a numeric or string expression can be converted to a Date variable. +
+ +Syntax: + +IsDate (Expression) + + +Return value: +Bool + +Parameters: + Expression: Any numeric or string expression that you want to test. If the expression can be converted to a date, the function returns True, otherwise the function returns False. + + + +Example: + +Sub ExampleIsDate +Dim sDateVar As String + sDateVar = "12.12.1997" + Print IsDate(sDateVar) ' Returns True + sDateVar = "12121997" + Print IsDate(sDateVar) ' Returns False +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03102400.xhp b/helpcontent2/source/text/sbasic/shared/03102400.xhp new file mode 100644 index 000000000..d16dc7e18 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102400.xhp @@ -0,0 +1,64 @@ + + + + + + + IsEmpty Function + /text/sbasic/shared/03102400.xhp + + + + + + +
+ + IsEmpty function + + + +IsEmpty Function +Tests if a Variant variable contains the Empty value. The Empty value indicates that the variable is not initialized. +
+ +Syntax: + +IsEmpty (Var) + + +Return value: +Bool + +Parameters: + Var: Any variable that you want to test. If the Variant contains the Empty value, the function returns True, otherwise the function returns False. + + + +Example: + +Sub ExampleIsEmpty +Dim sVar As Variant + sVar = Empty + Print IsEmpty(sVar) ' Returns True +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03102450.xhp b/helpcontent2/source/text/sbasic/shared/03102450.xhp new file mode 100644 index 000000000..c08464407 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102450.xhp @@ -0,0 +1,50 @@ + + + + + + + + IsError Function + /text/sbasic/shared/03102450.xhp + + + IsError + + + +
+ IsError function + +

IsError Function

+ Tests if a variable contains an error value. +
+

Syntax:

+ + IsError (Var) + +

Return value:

+ Bool +

Parameters:

+ Var: Any variable that you want to test. If the variable contains an error value, the function returns True, otherwise the function returns False. +
+ +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03102600.xhp b/helpcontent2/source/text/sbasic/shared/03102600.xhp new file mode 100644 index 000000000..752fbacdf --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102600.xhp @@ -0,0 +1,65 @@ + + + + + + + IsNull Function + /text/sbasic/shared/03102600.xhp + + + + + + +
+ + IsNull function + Null value + + + +IsNull Function +Tests if a Variant contains the special Null value, indicating that the variable does not contain data. +
+ +Syntax: + +IsNull (Var) + + +Return value: +Bool + +Parameters: + Var: Any variable that you want to test. This function returns True if the Variant contains the Null value, or False if the Variant does not contain the Null value. + Null - This value is used for a variant data sub type without valid contents. + + + +Example: + +Sub ExampleIsNull +Dim vVar As Variant + MsgBox IsNull(vVar) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03102700.xhp b/helpcontent2/source/text/sbasic/shared/03102700.xhp new file mode 100644 index 000000000..47fa8b657 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102700.xhp @@ -0,0 +1,66 @@ + + + + + + + IsNumeric Function + /text/sbasic/shared/03102700.xhp + + + + + + +
+ + IsNumeric function + + + +IsNumeric Function +Tests if an expression is a number. If the expression is a number, the function returns True, otherwise the function returns False. +
+ +Syntax: + +IsNumeric (Var) + + +Return value: +Bool + +Parameters: + Var: Any expression that you want to test. + + + +Example: + +Sub ExampleIsNumeric +Dim vVar As Variant + vVar = "ABC" + Print IsNumeric(vVar) ' Returns False + vVar = "123" + Print IsNumeric(vVar) ' Returns True +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03102800.xhp b/helpcontent2/source/text/sbasic/shared/03102800.xhp new file mode 100644 index 000000000..650992598 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102800.xhp @@ -0,0 +1,68 @@ + + + + + +IsObject Function +/text/sbasic/shared/03102800.xhp + + +Sun Microsystems, Inc. + + + +
+IsObject function + +IsObject Function +Tests if a variable is an object, as opposed to primitive data types such as dates, numbers, texts. The function returns True if the variable is an object, otherwise it returns False. +
+Syntax: + +IsObject(var) + +Return value: +Boolean +Parameters: + +var: Any variable that you want to test. + + +The following objects return True: + + OLE objects or UNO objects + Class module object instances + Extended types or enumerations + Routines or variables when defined as Object. + %PRODUCTNAME Basic modules + + Data structures return True even when empty. Object defined variables return True even if uninitialized. +
+ Enum statement + + + + + + + Type statement + Using variables +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03102900.xhp b/helpcontent2/source/text/sbasic/shared/03102900.xhp new file mode 100644 index 000000000..957e589c4 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03102900.xhp @@ -0,0 +1,70 @@ + + + + + + + LBound Function + /text/sbasic/shared/03102900.xhp + + + + + +
+ + LBound function + + +

LBound Function

+Returns the lower boundary of an array. +
+ + + +LBound (ArrayName [, Dimension]) + + + +Long + + + ArrayName: Name of the array for which you want to return the upper (Ubound) or the lower (LBound) boundary of the array dimension. + [Dimension]: Integer that specifies which dimension to return the upper (Ubound) or the lower (LBound) boundary for. If a value is not specified, the first dimension is assumed. + + + + + + +Sub VectorBounds + Dim v(10 To 20) As String + Print LBound(v()) ' returns 10 + Print UBound(v) ' returns 20 +End Sub ' VectorBounds + +Sub TableBounds + Dim t(10 To 20,-5 To 70) As Currency + Print LBound(t), UBound(t()) ' returns 10 20 + Print LBound(t(),2) ' returns - 5 + Print UBound(t,2) ' returns 70 +End Sub ' TableBounds + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03103000.xhp b/helpcontent2/source/text/sbasic/shared/03103000.xhp new file mode 100644 index 000000000..05cc3c862 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103000.xhp @@ -0,0 +1,73 @@ + + + + + + + UBound Function + /text/sbasic/shared/03103000.xhp + + + + + + +
+ + UBound function + + + +

UBound Function

+Returns the upper boundary of an array. +
+ + + +UBound (ArrayName [, Dimension]) + + + +Long + + + ArrayName: Name of the array for which you want to determine the upper (Ubound) or the lower (LBound) boundary. + [Dimension]: Integer that specifies which dimension to return the upper(Ubound) or lower (LBound) boundary for. If no value is specified, the boundary of the first dimension is returned. + + + + + + +Sub VectorBounds + Dim v(10 To 20) As String + Print LBound(v()) ' returns 10 + Print UBound(v) ' returns 20 +End Sub ' VectorBounds + +Sub TableBounds + Dim t(10 To 20,-5 To 70) As Currency + Print LBound(t), UBound(t()) ' returns 10 20 + Print LBound(t(),2) ' returns - 5 + Print UBound(t,2) ' returns 70 +End Sub ' TableBounds + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03103100.xhp b/helpcontent2/source/text/sbasic/shared/03103100.xhp new file mode 100644 index 000000000..a03f8e04d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103100.xhp @@ -0,0 +1,63 @@ + + + + + + + Let Statement + /text/sbasic/shared/03103100.xhp + + + + + + +
+ + Let statement + + + +Let Statement +Assigns a value to a variable. +
+ +Syntax: + + Let Statement diagram + + +[Let] variable = expression + + +Parameters: + variable: Variable that you want to assign a value to. Value and variable type must be compatible. +As in most BASIC dialects, the keyword Let is optional. + +Example: + +Sub ExampleLet +Dim sText As String + Let sText = "Las Vegas" + MsgBox Len(sText) ' returns 9 +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03103200.xhp b/helpcontent2/source/text/sbasic/shared/03103200.xhp new file mode 100644 index 000000000..d7418435a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103200.xhp @@ -0,0 +1,54 @@ + + + + + + + Option Base Statement + /text/sbasic/shared/03103200.xhp + + + + + +
+ + Option Base statement + + +

Option Base Statement

+Defines the default lower boundary for arrays as 0 or 1. +
+ + +Option Base { 0 | 1} + + +This statement must be added before the executable program code in a module. + + + +Option Base 1 +Sub ExampleOptionBase + Dim sVar(20) As String + MsgBox LBound(sVar()) +End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03103300.xhp b/helpcontent2/source/text/sbasic/shared/03103300.xhp new file mode 100644 index 000000000..96c490d39 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103300.xhp @@ -0,0 +1,57 @@ + + + + + + + Option Explicit Statement + /text/sbasic/shared/03103300.xhp + + + + + +
+ + Option Explicit statement + + +

Option Explicit Statement

+Specifies that every variable in the program code must be explicitly declared with the Dim statement. +
+ + +Option Explicit + + + + + + +Option Explicit +Sub ExampleExplicit +Dim sVar As String + sVar = "Las Vegas" + For i% = 1 To 10 ' This results in a run-time error + Rem + Next i% +End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03103350.xhp b/helpcontent2/source/text/sbasic/shared/03103350.xhp new file mode 100644 index 000000000..687b1ffb9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103350.xhp @@ -0,0 +1,69 @@ + + + + + + + Option VBASupport Statement + /text/sbasic/shared/03103350.xhp + + + + + + +
+ + Microsoft Excel macros support;Enable + Microsoft Excel macros support;Option VBASupport statement + VBA Support;Option VBASupport statement + Option VBASupport statement + +

Option VBASupport Statement

+Specifies that %PRODUCTNAME Basic will support some VBA statements, functions and objects. +
+The support for VBA is not complete, but covers a large portion of the common usage patterns. + +When VBA support is enabled, %PRODUCTNAME Basic function arguments and return values are the same as their VBA functions counterparts. When the support is disabled, %PRODUCTNAME Basic functions may accept arguments and return values different of their VBA counterparts. + +Option VBASupport {1|0} + + + +1: Enable VBA support in %PRODUCTNAME +0: Disable VBA support + + + +Option VBASupport 1 +Sub ExampleVBA + Dim sVar As Single + sVar = Worksheets("Sheet1").Range("A1") + Print sVar +End Sub + + +
+VBA Properties +VBA support in %PRODUCTNAME + + +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03103400.xhp b/helpcontent2/source/text/sbasic/shared/03103400.xhp new file mode 100644 index 000000000..b56fe0d94 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103400.xhp @@ -0,0 +1,56 @@ + + + + + + + Public Statement + /text/sbasic/shared/03103400.xhp + + + + + + +
+ + Public statement + + + +Public Statement +Dimensions a variable or an array at the module level (that is, not within a subroutine or function), so that the variable and the array are valid in all libraries and modules. +
+ +Syntax: + +Public VarName[(start To end)] [As VarType][, VarName2[(start To end)] [As VarType][,...]] + + +Example: + +Public iPublicVar As Integer +Sub ExamplePublic + iPublicVar = iPublicVar + 1 + MsgBox iPublicVar +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03103450.xhp b/helpcontent2/source/text/sbasic/shared/03103450.xhp new file mode 100644 index 000000000..b2c0e5144 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103450.xhp @@ -0,0 +1,56 @@ + + + + + + + Global Statement + /text/sbasic/shared/03103450.xhp + + + + + + +
+ + Global keyword + + + +Global keyword +Dimensions a variable or an array at the global level (that is, not within a subroutine or function), so that the variable and the array are valid in all libraries and modules for the current session. +
+ +Syntax: + +Global VarName[(start To end)] [As VarType][, VarName2[(start To end)] [As VarType][,...]] + + +Example: + +Global iGlobalVar As Integer +Sub ExampleGlobal + iGlobalVar = iGlobalVar + 1 + MsgBox iGlobalVar +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03103500.xhp b/helpcontent2/source/text/sbasic/shared/03103500.xhp new file mode 100644 index 000000000..52a0261bb --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103500.xhp @@ -0,0 +1,71 @@ + + + + + + + Static Statement + /text/sbasic/shared/03103500.xhp + + + + + + +
+ + Static statement + + + +Static Statement +Declares a variable or an array at the procedure level within a subroutine or a function, so that the values of the variable or the array are retained after exiting the subroutine or function. Dim statement conventions are also valid. +
+The Static statement cannot be used to define variable arrays. Arrays must be specified according to a fixed size. + +Syntax: + +Static VarName[(start To end)] [As VarType], VarName2[(start To end)] [As VarType], ... + + +Example: + +Sub ExampleStatic +Dim iCount As Integer, iResult As Integer + For iCount = 0 To 2 + iResult = InitVar() + Next iCount + MsgBox iResult,0,"The answer is" +End Sub + +' Function for initialization of the static variable +Function InitVar() As Integer + Static iInit As Integer + Const iMinimum As Integer = 40 ' minimum return value of this function + If iInit = 0 Then ' check if initialized + iInit = iMinimum + Else + iInit = iInit + 1 + End If + InitVar = iInit +End Function + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03103600.xhp b/helpcontent2/source/text/sbasic/shared/03103600.xhp new file mode 100644 index 000000000..ff74db48e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103600.xhp @@ -0,0 +1,277 @@ + + + + + + + TypeName Function; VarType Function + /text/sbasic/shared/03103600.xhp + + + + + + +
+ + TypeName function + VarType function + + + +TypeName Function; VarType Function +Returns a string (TypeName) or a numeric value (VarType) that contains information for a variable. +
+ +Syntax: + +TypeName (Variable) / VarType (Variable) + + +Return value: +String; Integer + +Parameters: + Variable: The variable that you want to determine the type of. You can use the following values: + + + + + key word + + + Named constant + + + VarType + + + Variable type + + + + + Boolean + + + + + + 11 + + + Boolean variable + + + + Byte + + + + + + 17 + + + Byte variable + + + + + Date + + + V_DATE + + + 7 + + + Date variable + + + + + Currency + + + V_CURRENCY + + + 6 + + + Currency variable + + + + + Double + + + V_DOUBLE + + + 5 + + + Double floating point variable + + + + + Integer + + + V_INTEGER + + + 2 + + + Integer variable + + + + + Long + + + V_LONG + + + 3 + + + Long integer variable + + + + + Object + + + + + + 9 + + + Object variable + + + + + Single + + + V_SINGLE + + + 4 + + + Single floating-point variable + + + + + String + + + V_STRING + + + 8 + + + String variable + + + + + Variant + + + + + + 12 + + + Variant variable (can contain all types specified by the definition) + + + + + Empty + + + V_EMPTY + + + 0 + + + Variable is not initialized + + + + + Null + + + V_NULL + + + 1 + + + No valid data + + +
+ + + + +Example: + +Sub ExampleType +Dim iVar As Integer +Dim sVar As String +Dim siVar As Single +Dim dVar As Double +Dim bVar As Boolean +Dim lVar As Long +Dim cVar as Currency +Dim tVar as Date + MsgBox TypeName(iVar) & " " & VarType(iVar) & Chr(13) &_ + TypeName(sVar) & " " & VarType(sVar) & Chr(13) &_ + TypeName(siVar) & " " & VarType(siVar) & Chr(13) &_ + TypeName(dVar) & " " & VarType(dVar) & Chr(13) &_ + TypeName(bVar) & " " & VarType(bVar) & Chr(13) &_ + TypeName(cVar) & " " & VarType(cVar) & Chr(13) &_ + TypeName(tVar) & " " & VarType(tVar) & Chr(13) &_ + TypeName(lVar) & " " & VarType(lVar),0,"Some types In $[officename] Basic" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03103700.xhp b/helpcontent2/source/text/sbasic/shared/03103700.xhp new file mode 100644 index 000000000..dbbfa1cb3 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103700.xhp @@ -0,0 +1,73 @@ + + + + + + + Set Statement + /text/sbasic/shared/03103700.xhp + + + + + +
+ + Set statement + New keyword + Nothing object + + + +Set Statement +Sets an object reference on a variable. +
+ +Syntax: + + Set Statement diagram + + +[Set] variable = [New] object + + +Parameters: + variable: a variable or a property that requires an object reference. + expression: A computable combination of terms such as a formula or an object property or method. + object: Object that the variable refers to. + Nothing - Assign Nothing to a variable to remove a previous assignment. +Set keyword is optional. Nothing is the default value for objects. +Example: + +Sub ExampleSet + Dim obj As Object + Set obj = ThisComponent + Print obj.Title + + obj = New com.sun.star.beans.PropertyValue + With obj + .Name = "key" : .Value = 594.34 + Print .Name, .Value + End With +End Sub + +New creates UNO objects or class module objects, before assigning it to a variable. + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03103800.xhp b/helpcontent2/source/text/sbasic/shared/03103800.xhp new file mode 100644 index 000000000..f77b77da8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103800.xhp @@ -0,0 +1,68 @@ + + + + + + + +FindObject Function +/text/sbasic/shared/03103800.xhp + + +Sun Microsystems, Inc. + + + +
+FindObject function + +FindObject Function +Enables an object to be addressed at run-time as a string parameter through the object name. +
+
+For example, the following command: + +MyObj.Prop1.Command = 5 + +corresponds to the command block: + +Dim ObjVar as Object +Dim ObjProp as Object +ObjName As String = "MyObj" +ObjVar = FindObject( ObjName As String ) +PropName As String = "Prop1" +ObjProp = FindPropertyObject( ObjVar, PropName As String ) +ObjProp.Command = 5 + +This allows names to be dynamically created at run-time. For example: +"TextEdit1" to "TextEdit5" in a loop to create five control names. +
+See also: FindPropertyObject +Syntax: + +FindObject( ObjName As String ) + +Parameters: + +ObjName: String that specifies the name of the object that you want to address at run-time. + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03103900.xhp b/helpcontent2/source/text/sbasic/shared/03103900.xhp new file mode 100644 index 000000000..75486f5bf --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03103900.xhp @@ -0,0 +1,56 @@ + + + + + + + +FindPropertyObject Function +/text/sbasic/shared/03103900.xhp + + +Sun Microsystems, Inc. + + + +
+FindPropertyObject function + +FindPropertyObject Function +Enables objects to be addressed at run-time as a string parameter using the object name. +
+ +See also: FindObject +Syntax: + +FindPropertyObject( ObjVar, PropName As String ) + +Parameters: + +ObjVar: Object variable that you want to dynamically define at run-time. + +PropName: String that specifies the name of the property that you want to address at run-time. + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03104000.xhp b/helpcontent2/source/text/sbasic/shared/03104000.xhp new file mode 100644 index 000000000..f12213c9f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03104000.xhp @@ -0,0 +1,52 @@ + + + + + + + +IsMissing function +/text/sbasic/shared/03104000.xhp + + +Sun Microsystems, Inc. + + + +
+IsMissing function + +IsMissing Function +Tests if a function is called with an optional parameter. +
+See also: Optional +Syntax: + +IsMissing( ArgumentName ) + +Parameters: + +ArgumentName: the name of an optional argument. +If the IsMissing function is called by the ArgumentName, then True is returned. +See also Examples. + + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03104100.xhp b/helpcontent2/source/text/sbasic/shared/03104100.xhp new file mode 100644 index 000000000..26e9b2201 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03104100.xhp @@ -0,0 +1,50 @@ + + + + + + + +Optional (in Function Statement) +/text/sbasic/shared/03104100.xhp + + +Sun Microsystems, Inc. + + + +
+Optional function + +Optional (in Function Statement) +Allows you to define parameters that are passed to a function as optional. +
+See also: IsMissing +Syntax: + +Function MyFunction(Text1 As String, Optional Arg2, Optional Arg3) + +Examples: + + Result = MyFunction("Here", 1, "There") ' all arguments are passed. + Result = MyFunction("Test", ,1) ' second argument is missing. + +See also Examples. + +
diff --git a/helpcontent2/source/text/sbasic/shared/03104200.xhp b/helpcontent2/source/text/sbasic/shared/03104200.xhp new file mode 100644 index 000000000..4657343f2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03104200.xhp @@ -0,0 +1,53 @@ + + + + + + + +Array Function +/text/sbasic/shared/03104200.xhp + + +Sun Microsystems, Inc. + + + +
+Array function + +Array Function +Returns the type Variant with a data field. +
+Syntax: + +Array ( Argument list) + +See also DimArray +Parameters: + +Argument list: A list of any number of arguments that are separated by commas. +Example: + + Dim A As Variant + A = Array("Fred","Tom","Bill") + Msgbox A(2) + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03104300.xhp b/helpcontent2/source/text/sbasic/shared/03104300.xhp new file mode 100644 index 000000000..c378ee698 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03104300.xhp @@ -0,0 +1,54 @@ + + + + + + + +DimArray Function +/text/sbasic/shared/03104300.xhp + + +Sun Microsystems, Inc. + + + +
+DimArray function + +DimArray Function +Returns a Variant array. +
+Syntax: + +DimArray ( Argument list) + +See also Array +If no parameters are passed, an empty array is created (like Dim A() that is the same as a sequence of length 0 in Uno). If parameters are specified, a dimension is created for each parameter. +Parameters: + +Argument list: A list of any number of arguments that are separated by commas. + + +Example: + + a = DimArray( 2, 2, 4 ) ' is the same as DIM a( 2, 2, 4 ) + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03104400.xhp b/helpcontent2/source/text/sbasic/shared/03104400.xhp new file mode 100644 index 000000000..510b18fc2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03104400.xhp @@ -0,0 +1,53 @@ + + + + + + + +HasUnoInterfaces Function +/text/sbasic/shared/03104400.xhp + + +Sun Microsystems, Inc. + + + +
+HasUnoInterfaces function + +HasUnoInterfaces Function +Tests if a Basic Uno object supports certain Uno interfaces. +
+Returns True, if all stated Uno interfaces are supported, otherwise False is returned. + +HasUnoInterfaces( oTest, Uno-Interface-Name 1 [, Uno-Interface-Name 2, ...]) + +Bool + + +oTest: the Basic Uno object that you want to test. + +Uno-Interface-Name: list of Uno interface names. + + + bHas = HasUnoInterfaces( oTest, "com.sun.star.beans.XIntrospection" ) + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03104500.xhp b/helpcontent2/source/text/sbasic/shared/03104500.xhp new file mode 100644 index 000000000..c97e8916f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03104500.xhp @@ -0,0 +1,63 @@ + + + + + + + IsUnoStruct Function + /text/sbasic/shared/03104500.xhp + + + +
+ + IsUnoStruct function + +IsUnoStruct Function +Returns True if the given object is a Uno struct. +
+ + +IsUnoStruct( Uno type ) + +Bool + + +Uno type : A UnoObject + + + +Sub Main +Dim bIsStruct +' Instantiate a service +Dim oSimpleFileAccess +oSimpleFileAccess = CreateUnoService( "com.sun.star.ucb.SimpleFileAccess" ) +bIsStruct = IsUnoStruct( oSimpleFileAccess ) +MsgBox bIsStruct ' Displays False because oSimpleFileAccess Is NO struct +' Instantiate a Property struct +Dim aProperty As New com.sun.star.beans.Property +bIsStruct = IsUnoStruct( aProperty ) +MsgBox bIsStruct ' Displays True because aProperty is a struct +bIsStruct = IsUnoStruct( 42 ) +MsgBox bIsStruct ' Displays False because 42 is NO struct +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03104600.xhp b/helpcontent2/source/text/sbasic/shared/03104600.xhp new file mode 100644 index 000000000..1339f6bc6 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03104600.xhp @@ -0,0 +1,54 @@ + + + + + + + +EqualUnoObjects Function +/text/sbasic/shared/03104600.xhp + + +Sun Microsystems, Inc. + + + +
+EqualUnoObjects function + +EqualUnoObjects Function +Returns True if the two specified Basic Uno objects represent the same Uno object instance. +
+ +EqualUnoObjects( oObj1, oObj2 ) + +Bool + + + ' Copy of objects -> same instance + oIntrospection = CreateUnoService( "com.sun.star.beans.Introspection" ) + oIntro2 = oIntrospection + print EqualUnoObjects( oIntrospection, oIntro2 ) + ' Copy of structs as value -> new instance + Dim Struct1 as new com.sun.star.beans.Property + Struct2 = Struct1 + print EqualUnoObjects( Struct1, Struct2 ) + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03104700.xhp b/helpcontent2/source/text/sbasic/shared/03104700.xhp new file mode 100644 index 000000000..968cac313 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03104700.xhp @@ -0,0 +1,64 @@ + + + + + + + + Erase Statement + /text/sbasic/shared/03104700.xhp + + Erase + + + + +
+Erase statement + +Erase Statement +Erases the contents of array elements of fixed size arrays, and releases the memory used by arrays of variable size. +
+ + +Erase syntax + + Erase array1 [, array2 [,...]] + + + +array list - A comma delimited list of arrays to be erased. + + + + Sub Erase_Example + a = Array(1,2,3) : b= Array("z","y","x") : c=Array(a,b) + Erase a, c(Ubound(c)) ' b and c(0) are unchanged + Erase b, c(0) ' everything gets cleared + End Sub + + +
+ Dim or ReDim statements + Array or DimArray functions + Lbound and Ubound functions +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03110000.xhp b/helpcontent2/source/text/sbasic/shared/03110000.xhp new file mode 100644 index 000000000..57de37d1e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03110000.xhp @@ -0,0 +1,41 @@ + + + + + + + + +Comparison Operators +/text/sbasic/shared/03110000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Comparison Operators + The available comparison operators are described here. +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03110100.xhp b/helpcontent2/source/text/sbasic/shared/03110100.xhp new file mode 100644 index 000000000..65af4360d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03110100.xhp @@ -0,0 +1,76 @@ + + + + + + + Comparison Operators + /text/sbasic/shared/03110100.xhp + + + + + + +
+ + comparison operators;%PRODUCTNAME Basic + operators;comparisons + + + +Comparison Operators +Comparison operators compare two expressions. The result is returned as a Boolean expression that determines if the comparison is True (-1) or False (0). +
+ +Syntax: + +Result = Expression1 { = | < | > | <= | >= } Expression2 + + +Parameters: + Result: Boolean expression that specifies the result of the comparison (True, or False) + Expression1, Expression2: Any numeric values or strings that you want to compare. + +Comparison operators += : Equal to +< : Less than +> : Greater than +<= : Less than or equal to +>= : Greater than or equal to +<> : Not equal to + +Example: + +Sub ExampleUnequal +Dim sFile As String +Dim sRoot As String ' Root directory for file in and output + sRoot = "c:\" + sFile = Dir$( sRoot ,22) + If sFile <> "" Then + Do + MsgBox sFile + sFile = Dir$ + Loop Until sFile = "" + End If +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120000.xhp b/helpcontent2/source/text/sbasic/shared/03120000.xhp new file mode 100644 index 000000000..16c686713 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120000.xhp @@ -0,0 +1,45 @@ + + + + + + + + +Strings +/text/sbasic/shared/03120000.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Strings + The following functions and statements validate and return strings. +
+ You can use strings to edit text within $[officename] Basic programs. + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120100.xhp b/helpcontent2/source/text/sbasic/shared/03120100.xhp new file mode 100644 index 000000000..dccf9aeb6 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120100.xhp @@ -0,0 +1,45 @@ + + + + + + + + +ASCII/ANSI Conversion in Strings +/text/sbasic/shared/03120100.xhp + + +Sun Microsystems, Inc. + + + + + +
+ ASCII/ANSI Conversion in Strings + The following functions convert strings to and from ASCII or ANSI code. +
+ + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120101.xhp b/helpcontent2/source/text/sbasic/shared/03120101.xhp new file mode 100644 index 000000000..d5e7a7eaf --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120101.xhp @@ -0,0 +1,69 @@ + + + + + + + Asc Function + /text/sbasic/shared/03120101.xhp + + + + + + +
+ + Asc function + + + +Asc Function +Returns the ASCII (American Standard Code for Information Interchange) value of the first character in a string expression. +
+ +Syntax: + +Asc (Text As String) + + +Return value: +Integer + +Parameters: + Text: Any valid string expression. Only the first character in the string is relevant. +Use the Asc function to replace keys with values. If the Asc function encounters a blank string, $[officename] Basic reports a run-time error. In addition to 7 bit ASCII characters (Codes 0-127), the ASCII function can also detect non-printable key codes in ASCII code. This function can also handle 16 bit unicode characters. + + + +Example: + +Sub ExampleASC + Print ASC("A") ' returns 65 + Print ASC("Z") ' returns 90 + Print ASC("Las Vegas") ' returns 76, since only the first character is taken into account +End Sub + + +
+CHR +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120102.xhp b/helpcontent2/source/text/sbasic/shared/03120102.xhp new file mode 100644 index 000000000..a18c3beb1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120102.xhp @@ -0,0 +1,68 @@ + + + + + + + Chr Function + /text/sbasic/shared/03120102.xhp + + + + +
+ + Chr function + + Chr Function + Returns the character that corresponds to the specified character code. +
+ + + + Chr(Expression As Integer) + + + String + + + Expression: a numeric expression that represents a valid 8-bit ASCII value (0-255) or a 16-bit Unicode value. (To support expressions with a nominally negative argument like Chr(&H8000) in a backwards-compatible way, values in the range −32768 to −1 are internally mapped to the range 32768 to 65535.) + + When VBA compatibility mode is enabled (OPTION VBASUPPORT 1), Expression is a numeric expression that represents a valid 8-bit ASCII value (0-255) only. + + Use the Chr$ function to send special control sequences to a printer or to another output source. You can also use it to insert quotation marks in a string expression. + + + , when VBA compatibility mode is enabled and expression is greater than 255. + + + + Sub ExampleChr + ' This example inserts quotation marks (ASCII value 34) in a string. + MsgBox "A "+ Chr$(34)+"short" + Chr$(34)+" trip." + ' The printout appears in the dialog as: A "short" trip. + End Sub + + +
+ ASC +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120103.xhp b/helpcontent2/source/text/sbasic/shared/03120103.xhp new file mode 100644 index 000000000..d214ed606 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120103.xhp @@ -0,0 +1,67 @@ + + + + + + + Str Function + /text/sbasic/shared/03120103.xhp + + + + + + +
+ + Str function + + + +Str Function +Converts a numeric expression into a string. +
+ +Syntax: + +Str (Expression) + + +Return value: +String + +Parameters: + Expression: Any numeric expression. +The Str function converts a numeric variable, or the result of a calculation into a string. Negative numbers are preceded by a minus sign. Positive numbers are preceded by a space (instead of the plus sign). + + + +Example: + +Sub ExampleStr +Dim iVar As Single +Dim sVar As String + iVar = 123.123 + sVar = LTrim(Str(iVar)) + MsgBox sVar & chr(13) & Str(iVar) +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120104.xhp b/helpcontent2/source/text/sbasic/shared/03120104.xhp new file mode 100644 index 000000000..8d34db2a8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120104.xhp @@ -0,0 +1,64 @@ + + + + + + + Val Function + /text/sbasic/shared/03120104.xhp + + + + + + +
+ + Val function + + + +Val Function +Converts a string to a numeric expression. +
+ +Syntax: + +Val (Text As String) + + +Return value: +Double + +Parameters: + Text: String that represents a number. +Using the Val function, you can convert a string that represents numbers into numeric expressions. This is the inverse of the Str function. If only part of the string contains numbers, only the first appropriate characters of the string are converted. If the string does not contain any numbers, the Val function returns the value 0. + + + +Example: + +Sub ExampleVal + MsgBox Val("123.123") + MsgBox Val("A123.123") +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120105.xhp b/helpcontent2/source/text/sbasic/shared/03120105.xhp new file mode 100644 index 000000000..e4d8befc2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120105.xhp @@ -0,0 +1,51 @@ + + + + + + + +CByte Function +/text/sbasic/shared/03120105.xhp + + +Sun Microsystems, Inc. + + + +
+CByte function + +CByte Function +Converts a string or a numeric expression to the type Byte. +
+Syntax: + +Cbyte( expression ) + +Return value: +Byte +Parameters: + +Expression: A string or a numeric expression. + + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03120111.xhp b/helpcontent2/source/text/sbasic/shared/03120111.xhp new file mode 100644 index 000000000..4ee05ef53 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120111.xhp @@ -0,0 +1,68 @@ + + + + + + + AscW Function + /text/sbasic/shared/03120111.xhp + + + + + + +
+ + AscW function + + + +AscW Function [VBA] +Returns the Unicode value of the first character in a string expression. +
+ + + +AscW (Text As String) + + +Integer + + Text: Any valid string expression. Only the first character in the string is relevant. +Use the AscW function to replace keys with Unicode values. If the AscW function encounters a blank string, %PRODUCTNAME Basic reports a run-time error. Returned values are between 0 and 65535. + + + + +Sub ExampleAscW + Print AscW("A") ' returns 65 + Print AscW("Ω") ' returns 937 + Print AscW("Αθήνα") ' returns 913, since only the first character (Alpha) is taken into account +End Sub + + +
+Chr +ChrW +Asc +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120112.xhp b/helpcontent2/source/text/sbasic/shared/03120112.xhp new file mode 100644 index 000000000..39f9cebee --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120112.xhp @@ -0,0 +1,68 @@ + + + + + + + ChrW Function [VBA] + /text/sbasic/shared/03120112.xhp + + + + + + +
+ + ChrW function + + + +ChrW Function [VBA] +Returns the Unicode character that corresponds to the specified character code. +
+ + + +ChrW(Expression As Integer) + + +String + + Expression: Numeric variables that represent a valid 16 bit Unicode value (0-65535). (To support expressions with a nominally negative argument like ChrW(&H8000) in a backwards-compatible way, values in the range −32768 to −1 are internally mapped to the range 32768 to 65535.) An empty value returns error code 5. A value out of the range [0,65535] returns error code 6. + + + + + +Sub ExampleChrW + ' This example inserts the Greek letters alpha and omega in a string. + MsgBox "From "+ ChrW(913)+" to " + ChrW(937) + ' The printout appears in the dialog as: From Α to Ω +End Sub + + +
+Chr +Asc +AscW +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120200.xhp b/helpcontent2/source/text/sbasic/shared/03120200.xhp new file mode 100644 index 000000000..5d58edee1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120200.xhp @@ -0,0 +1,42 @@ + + + + + + + + +Repeating Contents +/text/sbasic/shared/03120200.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Repeating Contents + The following functions repeat the contents of strings. +
+ + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120201.xhp b/helpcontent2/source/text/sbasic/shared/03120201.xhp new file mode 100644 index 000000000..815a840c7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120201.xhp @@ -0,0 +1,67 @@ + + + + + + + Space and Spc Function + /text/sbasic/shared/03120201.xhp + + + + + +
+ + Space function + Spc function + + +Space and Spc Functions +Returns a string that consists of a specified amount of spaces. +
+The Spc function works the same as the Space function. + + +Space (n As Long)
+Spc (n As Long) + + +String + + + n: Numeric expression that defines the number of spaces in the string. The maximum allowed value of n is 65535. + + + + + +Sub ExampleSpace +Dim sText As String, sOut As String +Dim iLen As Integer + iLen = 10 + sText = "Las Vegas" + sOut = sText & Space(iLen) & sText & Chr(13) &_ + sText & Space(iLen*2) & sText & Chr(13) &_ + sText & Space(iLen*4) & sText & Chr(13) + MsgBox sOut,0,"Info:" +End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120202.xhp b/helpcontent2/source/text/sbasic/shared/03120202.xhp new file mode 100644 index 000000000..e088ee718 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120202.xhp @@ -0,0 +1,68 @@ + + + + + + + String Function + /text/sbasic/shared/03120202.xhp + + + + + + +
+ + String function + + + +String Function +Creates a string according to the specified character, or the first character of a string expression that is passed to the function. +
+ +Syntax: + +String (n As Long, {expression As Integer | character As String}) + + +Return value: +String + +Parameters: + n: Numeric expression that indicates the number of characters to return in the string. The maximum allowed value of n is 65535. + Expression: Numeric expression that defines the ASCII code for the character. + Character: Any single character used to build the return string, or any string of which only the first character will be used. + + + +Example: + +Sub ExampleString +Dim sText As String + sText = String(10,"A") + MsgBox sText + sText = String(10,65) + MsgBox sText +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120300.xhp b/helpcontent2/source/text/sbasic/shared/03120300.xhp new file mode 100644 index 000000000..024dbd09f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120300.xhp @@ -0,0 +1,54 @@ + + + + + + + + + + +Editing String Contents +/text/sbasic/shared/03120300.xhp + + + +
+ampersand symbol in StarBasic +Editing String Contents +The following functions edit, format, and align the contents of strings. Use the & operator to concatenate strings. +
+ + + + + + + + + + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120301.xhp b/helpcontent2/source/text/sbasic/shared/03120301.xhp new file mode 100644 index 000000000..3f19ae6de --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120301.xhp @@ -0,0 +1,99 @@ + + + + + + + Format Function + /text/sbasic/shared/03120301.xhp + + + + + + +
+ + Format function + + + +Format Function +Converts a number to a string, and then formats it according to the format that you specify. +
+ +Syntax: + +Format (Number [, Format As String]) + + +Return value: +String + +Parameters: + Number: Numeric expression that you want to convert to a formatted string. + Format: String that specifies the format code for the number. If Format is omitted, the Format function works like the Str function. + +Formatting Codes +The following list describes the codes that you can use for formatting a number: + 0: If Number has a digit at the position of the 0 in the format code, the digit is displayed, otherwise a zero is displayed. +If Number has fewer digits than the number of zeros in the format code, (on either side of the decimal), leading or trailing zeros are displayed. If the number has more digits to the left of the decimal separator than the amount of zeros in the format code, the additional digits are displayed without formatting. +Decimal places in the number are rounded according to the number of zeros that appear after the decimal separator in the Format code. + #: If Number contains a digit at the position of the # placeholder in the Format code, the digit is displayed, otherwise nothing is displayed at this position. +This symbol works like the 0, except that leading or trailing zeroes are not displayed if there are more # characters in the format code than digits in the number. Only the relevant digits of the number are displayed. + .: The decimal placeholder determines the number of decimal places to the left and right of the decimal separator. +If the format code contains only # placeholders to the left of this symbol, numbers less than 1 begin with a decimal separator. To always display a leading zero with fractional numbers, use 0 as a placeholder for the first digit to the left of the decimal separator. + %: Multiplies the number by 100 and inserts the percent sign (%) where the number appears in the format code. + E- E+ e- e+ : If the format code contains at least one digit placeholder (0 or #) to the right of the symbol E-, E+, e-, or e+, the number is formatted in the scientific or exponential format. The letter E or e is inserted between the number and the exponent. The number of placeholders for digits to the right of the symbol determines the number of digits in the exponent. +If the exponent is negative, a minus sign is displayed directly before an exponent with E-, E+, e-, e+. If the exponent is positive, a plus sign is only displayed before exponents with E+ or e+. +The thousands delimiter is displayed if the format code contains the delimiter enclosed by digit placeholders (0 or #). +The use of a period as a thousands and decimal separator is dependent on the regional setting. When you enter a number directly in Basic source code, always use a period as decimal delimiter. The actual character displayed as a decimal separator depends on the number format in your system settings. + - + $ ( ) space: A plus (+), minus (-), dollar ($), space, or brackets entered directly in the format code is displayed as a literal character. +To display characters other than the ones listed here, you must precede it by a backslash (\), or enclose it in quotation marks (" "). +\ : The backslash displays the next character in the format code. +Characters in the format code that have a special meaning can only be displayed as literal characters if they are preceded by a backslash. The backslash itself is not displayed, unless you enter a double backslash (\\) in the format code. +Characters that must be preceded by a backslash in the format code in order to be displayed as literal characters are date- and time-formatting characters (a, c, d, h, m, n, p, q, s, t, w, y, /, :), numeric-formatting characters (#, 0, %, E, e, comma, period), and string-formatting characters (@, &, <, >, !). +You can also use the following predefined number formats. Except for "General Number", all of the predefined format codes return the number as a decimal number with two decimal places. +If you use predefined formats, the name of the format must be enclosed in quotation marks. + +Predefined format + General Number: Numbers are displayed as entered. + Currency: Inserts a dollar sign in front of the number and encloses negative numbers in brackets. + Fixed: Displays at least one digit in front of the decimal separator. + Standard: Displays numbers with a thousands separator. + Percent: Multiplies the number by 100 and appends a percent sign to the number. + Scientific: Displays numbers in scientific format (for example, 1.00E+03 for 1000). +A format code can be divided into three sections that are separated by semicolons. The first part defines the format for positive values, the second part for negative values, and the third part for zero. If you only specify one format code, it applies to all numbers. + + + + +Example: + +Sub ExampleFormat + MsgBox Format(6328.2, "##,##0.00") + ' always use a period as decimal delimiter when you enter numbers in Basic source code. + ' displays for example 6,328.20 in English locale, 6.328,20 in German locale. +End Sub + +
+ Number format codes +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03120302.xhp b/helpcontent2/source/text/sbasic/shared/03120302.xhp new file mode 100644 index 000000000..361545bfb --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120302.xhp @@ -0,0 +1,64 @@ + + + + + + + LCase Function + /text/sbasic/shared/03120302.xhp + + + + + + +
+ + LCase function + + + +LCase Function +Converts all uppercase letters in a string to lowercase. +
+See also: UCase Function + + +LCase (Text As String) + + +String + + + Text: Any string expression that you want to convert. + + + + + +Sub ExampleLUCase +Dim sVar As String + sVar = "Las Vegas" + Print LCase(sVar) ' Returns "las vegas" + Print UCase(sVar) ' Returns "LAS VEGAS" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120303.xhp b/helpcontent2/source/text/sbasic/shared/03120303.xhp new file mode 100644 index 000000000..cc0b41a88 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120303.xhp @@ -0,0 +1,72 @@ + + + + + + + Left Function + /text/sbasic/shared/03120303.xhp + + + + + + +
+ + Left function + + + +Left Function +Returns the number of leftmost characters that you specify of a string expression. +
+ +Syntax: + +Left (Text As String, n As Long) + + +Return value: +String + +Parameters: + Text: Any string expression that you want to return the leftmost characters from. + n: Numeric expression that specifies the number of characters that you want to return. If n = 0, a zero-length string is returned. The maximum allowed value is 65535. +The following example converts a date in YYYY.MM.DD format to MM/DD/YYYY format. + + + +Example: + +Sub ExampleUSDate +Dim sInput As String +Dim sUS_date As String + sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'") + sUS_date = Mid(sInput, 6, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Right(sInput, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Left(sInput, 4) + MsgBox sUS_date +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120304.xhp b/helpcontent2/source/text/sbasic/shared/03120304.xhp new file mode 100644 index 000000000..19e9d6450 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120304.xhp @@ -0,0 +1,81 @@ + + + + + + + LSet Statement + /text/sbasic/shared/03120304.xhp + + + + + + +
+ + LSet statement + + + +LSet Statement +Aligns a string to the left of a string variable, or copies a variable of a user-defined type to another variable of a different user-defined type. +
+ +Syntax: + +LSet Var As String = Text or LSet Var1 = Var2 + + +Parameters: + Var: Any String variable that contains the string that you want align to the left. + Text: String that you want to align to the left of the string variable. + Var1: Name of the user-defined type variable that you want to copy to. + Var2: Name of the user-defined type variable that you want to copy from. +If the string is shorter than the string variable, LSet left-aligns the string within the string variable. Any remaining positions in the string variable are replaced by spaces. If the string is longer than the string variable, only the leftmost characters up to the length of the string variable are copied. With the LSet statement, you can also copy a user-defined type variable to another variable of the same type. + +Example: + +Sub ExampleRLSet +Dim sVar As String +Dim sExpr As String + sVar = String(40,"*") + sExpr = "SBX" + ' Align "SBX" within the 40-character reference string + ' Replace asterisks with spaces + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123457896" + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(40,"*") + sExpr = "SBX" + ' Left-align "SBX" within the 40-character reference string + LSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123456789" + LSet sVar = sExpr + Print ">"; sVar; "<" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120305.xhp b/helpcontent2/source/text/sbasic/shared/03120305.xhp new file mode 100644 index 000000000..4cec0d7d7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120305.xhp @@ -0,0 +1,72 @@ + + + + + + + LTrim Function + /text/sbasic/shared/03120305.xhp + + + + + + +
+ + LTrim function + + + +LTrim Function +Removes all leading spaces at the start of a string expression. +
+ +Syntax: + +LTrim (Text As String) + + +Return value: +String + +Parameters: + Text: Any string expression. +Use this function to remove spaces at the beginning of a string expression. + + + +Example: + +Sub ExampleSpaces +Dim sText2 As String,sText As String,sOut As String + sText2 = " <*Las Vegas*> " + sOut = "'"+sText2 +"'"+ Chr(13) + sText = Ltrim(sText2) ' sText = "<*Las Vegas*> " + sOut = sOut + "'"+sText +"'" + Chr(13) + sText = Rtrim(sText2) ' sText = " <*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + Chr(13) + sText = Trim(sText2) ' sText = "<*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + MsgBox sOut +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120306.xhp b/helpcontent2/source/text/sbasic/shared/03120306.xhp new file mode 100644 index 000000000..bc95904c3 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120306.xhp @@ -0,0 +1,76 @@ + + + + + + + Mid Function, Mid Statement + /text/sbasic/shared/03120306.xhp + + + + + + +
+ + Mid function + Mid statement + + + +Mid Function, Mid Statement +Returns the specified portion of a string expression (Mid function), or replaces the portion of a string expression with another string (Mid statement). +
+ +Syntax: + +Mid (Text As String, Start As Long [, Length As Long]) or Mid (Text As String, Start As Long , Length As Long, Text As String) + + +Return value: +String (only by Function) + +Parameters: + Text: Any string expression that you want to modify. + Start: Numeric expression that indicates the character position within the string where the string portion that you want to replace or to return begins. The maximum allowed value is 65535.see i17928 + Length: Numeric expression that returns the number of characters that you want to replace or return. The maximum allowed value is 65535. +If the Length parameter in the Mid function is omitted, all characters in the string expression from the start position to the end of the string are returned. +If the Length parameter in the Mid statement is less than the length of the text that you want to replace, the text is reduced to the specified length. + Text: The string to replace the string expression (Mid statement). + + + +Example: + +Sub ExampleUSDate +Dim sInput As String +Dim sUS_date As String + sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'") + sUS_date = Mid(sInput, 6, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Right(sInput, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Left(sInput, 4) + MsgBox sUS_date +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120307.xhp b/helpcontent2/source/text/sbasic/shared/03120307.xhp new file mode 100644 index 000000000..4b6a7af3a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120307.xhp @@ -0,0 +1,73 @@ + + + + + + + Right Function + /text/sbasic/shared/03120307.xhp + + + + + + + +See also: Left Function. + +Syntax: + +Right (Text As String, n As Long) + + +Return value: +String + +Parameters: + Text: Any string expression that you want to return the rightmost characters of. + n: Numeric expression that defines the number of characters that you want to return. If n = 0, a zero-length string is returned. The maximum allowed value is 65535. +The following example converts a date in YYYY-MM-DD format to the US date format (MM/DD/YYYY). + + + +Example: + +Sub ExampleUSDate +Dim sInput As String +Dim sUS_date As String + sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'") + sUS_date = Mid(sInput, 6, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Right(sInput, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Left(sInput, 4) + MsgBox sUS_date +End Sub + + + + diff --git a/helpcontent2/source/text/sbasic/shared/03120308.xhp b/helpcontent2/source/text/sbasic/shared/03120308.xhp new file mode 100644 index 000000000..7ac77340e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120308.xhp @@ -0,0 +1,83 @@ + + + + + + + RSet Statement + /text/sbasic/shared/03120308.xhp + + + + + + +
+ + RSet statement + + + +RSet Statement +Right-aligns a string within a string variable, or copies a user-defined variable type into another. +
+ +Syntax: + +RSet Text As String = Text or RSet Variable1 = Variable2 + + +Parameters: + Text: Any string variable. + Text: String that you want to right-align in the string variable. + Variable1: User-defined variable that is the target for the copied variable. + Variable2: User-defined variable that you want to copy to another variable. +If the string is shorter than the string variable, RSet aligns the string to the right within the string variable. Any remaining characters in the string variable are replaced with spaces. If the string is longer than the string variable, characters exceeding the length of the variable are truncated, and only the remaining characters are right-aligned within the string variable. +You can also use the RSet statement to assign variables of one user-defined type to another. +The following example uses the RSet and LSet statements to modify the left and right alignment of a string. + +Example: + +Sub ExampleRLSet +Dim sVar As String +Dim sExpr As String + sVar = String(40,"*") + sExpr = "SBX" + ' Right-align "SBX" in a 40-character string + ' Replace asterisks with spaces + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123457896" + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(40,"*") + sExpr = "SBX" + ' Left-align "SBX" in a 40-character string + LSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123456789" + LSet sVar = sExpr + Print ">"; sVar; "<" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120309.xhp b/helpcontent2/source/text/sbasic/shared/03120309.xhp new file mode 100644 index 000000000..ec7b1cb1c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120309.xhp @@ -0,0 +1,72 @@ + + + + + + + RTrim Function + /text/sbasic/shared/03120309.xhp + + + + + + +
+ + RTrim function + + + +RTrim Function +Deletes the spaces at the end of a string expression. +
+See also: LTrim Function + +Syntax: + +RTrim (Text As String) + + +Return value: +String + +Parameters: + Text: Any string expression. + + + +Example: + +Sub ExampleSpaces +Dim sText2 As String,sText As String,sOut As String + sText2 = " <*Las Vegas*> " + sOut = "'"+sText2 +"'"+ Chr(13) + sText = Ltrim(sText2) ' sText = "<*Las Vegas*> " + sOut = sOut + "'"+sText +"'" + Chr(13) + sText = Rtrim(sText2) ' sText = " <*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + Chr(13) + sText = Trim(sText2) ' sText = "<*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + MsgBox sOut +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120310.xhp b/helpcontent2/source/text/sbasic/shared/03120310.xhp new file mode 100644 index 000000000..5c052abd2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120310.xhp @@ -0,0 +1,62 @@ + + + + + + + UCase Function + /text/sbasic/shared/03120310.xhp + + + + + + +
+ + UCase function + + + +UCase Function +Converts lowercase characters in a string to uppercase. +
+See also: LCase Function + +UCase (Text As String) + +String + + + Text: Any string expression that you want to convert. + + + + + +Sub ExampleLUCase +Dim sVar As String + sVar = "Las Vegas" + Print LCase(sVar) ' returns "las vegas" + Print UCase(sVar) ' returns "LAS VEGAS" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120311.xhp b/helpcontent2/source/text/sbasic/shared/03120311.xhp new file mode 100644 index 000000000..5dd60bae2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120311.xhp @@ -0,0 +1,71 @@ + + + + + + + Trim Function + /text/sbasic/shared/03120311.xhp + + + + + + +
+ + Trim function + + + +Trim Function +Removes all leading and trailing spaces from a string expression. +
+ +Syntax: + +Trim( Text As String ) + + +Return value: +String + +Parameters: + Text: Any string expression. + + + +Example: + +Sub ExampleSpaces +Dim sText2 As String,sText As String,sOut As String + sText2 = " <*Las Vegas*> " + sOut = "'"+sText2 +"'"+ Chr(13) + sText = Ltrim(sText2) ' sText = "<*Las Vegas*> " + sOut = sOut + "'"+sText +"'" + Chr(13) + sText = Rtrim(sText2) ' sText = " <*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + Chr(13) + sText = Trim(sText2) ' sText = "<*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + MsgBox sOut +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120312.xhp b/helpcontent2/source/text/sbasic/shared/03120312.xhp new file mode 100644 index 000000000..3c17b560b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120312.xhp @@ -0,0 +1,60 @@ + + + + + + + +ConvertToURL Function +/text/sbasic/shared/03120312.xhp + + +Sun Microsystems, Inc. + + + +
+ConvertToURL function + +ConvertToURL Function +Converts a system file name to a file URL. +
+Syntax: + +ConvertToURL(filename) + +Return value: +String +Parameters: + +Filename: A file name as string. + + +
+Example: + + systemFile$ = "c:\folder\mytext.txt" + url$ = ConvertToURL( systemFile$ ) + print url$ + systemFileAgain$ = ConvertFromURL( url$ ) + print systemFileAgain$ + +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03120313.xhp b/helpcontent2/source/text/sbasic/shared/03120313.xhp new file mode 100644 index 000000000..c9a98ce0a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120313.xhp @@ -0,0 +1,51 @@ + + + + + + + +ConvertFromURL Function +/text/sbasic/shared/03120313.xhp + + +Sun Microsystems, Inc. + + + +
+ConvertFromURL function + +ConvertFromURL Function +Converts a file URL to a system file name. +
+Syntax: + +ConvertFromURL(filename) + +Return value: +String +Parameters: + +Filename: A file name as a string. + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120314.xhp b/helpcontent2/source/text/sbasic/shared/03120314.xhp new file mode 100644 index 000000000..aae47d81c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120314.xhp @@ -0,0 +1,101 @@ + + + + + + + Split Function + /text/sbasic/shared/03120314.xhp + + + + + + +
+ + Split function + + + +Split Function +Returns an array of substrings from a string expression. +
+ +Syntax: + +Split (Text As String, delimiter, number) + + +Return value: +String + +Parameters: + Text: Any string expression. + delimiter (optional): A string of one or more characters length that is used to delimit the Text. The default is the space character. + number (optional): The number of substrings that you want to return. + +Example: + +
+ +Dim a(3) +Sub main() + a(0) = "ABCDE" + a(1) = 42 + a(2) = "MN" + a(3) = "X Y Z" + JStr = Join1() + Call Show(JStr, Split1(JStr)) + JStr = Join2() + Call Show(JStr, Split1(JStr)) + JStr = Join3() + Call Show(JStr, Split1(JStr)) +End Sub + +Function Join1() + Join1 = Join(a(), "abc") +End Function + +Function Join2() + Join2 = Join(a(), ",") +End Function + +Function Join3() + Join3 = Join(a()) +End Function + +Function Split1(aStr) + Split1 = Split(aStr, "D") +End Function + +Sub Show(JoinStr, TheArray) + l = LBound(TheArray) + u = UBound(TheArray) + total$ = "=============================" + Chr$(13) + JoinStr + Chr$(13) + Chr$(13) + For i = l To u + total$ = total$ + TheArray(i) + Str(Len(TheArray(i))) + Chr$(13) + Next i + MsgBox total$ +End Sub + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120315.xhp b/helpcontent2/source/text/sbasic/shared/03120315.xhp new file mode 100644 index 000000000..286c33e5d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120315.xhp @@ -0,0 +1,53 @@ + + + + + + + +Join Function +/text/sbasic/shared/03120315.xhp + + +Sun Microsystems, Inc. + + + +
+Join function + +Join Function +Returns a string from a number of substrings in a string array. +
+Syntax: + +Join (Text As String Array, delimiter) + +Return value: +String +Parameters: + +Text: A string array. + +delimiter (optional): A string character that is used to separate the substrings in the resulting string. The default delimiter is the space character. If delimiter is a string of length zero "", the substrings are joined without separator. +Example: + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03120400.xhp b/helpcontent2/source/text/sbasic/shared/03120400.xhp new file mode 100644 index 000000000..3250f7718 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120400.xhp @@ -0,0 +1,43 @@ + + + + + + + + +Editing String Length +/text/sbasic/shared/03120400.xhp + + +Sun Microsystems, Inc. + + + + + +
+ Editing String Length + The following functions determine string lengths and compare strings. +
+ + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120401.xhp b/helpcontent2/source/text/sbasic/shared/03120401.xhp new file mode 100644 index 000000000..a1ccb0bf7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120401.xhp @@ -0,0 +1,71 @@ + + + + + + + InStr Function + /text/sbasic/shared/03120401.xhp + + + + + + +
+ + InStr function + + + +InStr Function +Returns the position of a string within another string. +
+The Instr function returns the position at which the match was found. If the string was not found, the function returns 0. + +Syntax: + +InStr ([Start As Long,] Text1 As String, Text2 As String[, Compare]) + + +Return value: +Integer + +Parameters: + Start: A numeric expression that marks the position in a string where the search for the specified substring starts. If you omit this parameter, the search starts at the first character of the string. The maximum allowed value is 65535.see i17928 + Text1: The string expression that you want to search. + Text2: The string expression that you want to search for. + Compare: Optional numeric expression that defines the type of comparison. The value of this parameter can be 0 or 1. The default value of 1 specifies a text comparison that is not case-sensitive. The value of 0 specifies a binary comparison that is case-sensitive.fixes i17929 +To avoid a run-time error, do not set the Compare parameter if the first return parameter is omitted. + + + +Example: + +Sub ExamplePosition +Dim sInput As String +Dim iPos As Integer + sInput = "Office" + iPos = Instr(sInput,"c") + Print iPos +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120402.xhp b/helpcontent2/source/text/sbasic/shared/03120402.xhp new file mode 100644 index 000000000..f619c6bfe --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120402.xhp @@ -0,0 +1,59 @@ + + + + + + + +Len Function +/text/sbasic/shared/03120402.xhp + + +Sun Microsystems, Inc. + + + +
+Len function + +Len Function +Returns the number of characters in a string, or the number of bytes that are required to store a variable. +
+Syntax: + +Len (Text As String) + +Return value: +Long +Parameters: + +Text: Any string expression or a variable of another type. + + +Example: + +Sub ExampleLen +Dim sText as String + sText = "Las Vegas" + MsgBox Len(sText) REM Returns 9 +End Sub + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03120403.xhp b/helpcontent2/source/text/sbasic/shared/03120403.xhp new file mode 100644 index 000000000..0f59c4dcb --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120403.xhp @@ -0,0 +1,81 @@ + + + + + + + StrComp Function + /text/sbasic/shared/03120403.xhp + + + + + + +
+ + StrComp function + + + +StrComp Function +Compares two strings and returns an integer value that represents the result of the comparison. +
+ +Syntax: + +StrComp (Text1 As String, Text2 As String[, Compare]) + + +Return value: +Integer + +Parameter: + Text1: Any string expression + Text2: Any string expression + Compare: This optional parameter sets the comparison method. If Compare = 1, the string comparison is case-sensitive. If Compare = 0, no distinction is made between uppercase and lowercase letters. + +Return value + + + + If Text1 < Text2 the function returns -1 + + + If Text1 = Text2 the function returns 0 + + + If Text1 > Text2 the function returns 1 + + + + +Example: + +Sub ExampleStrComp +Dim iVar As Single +Dim sVar As String + iVar = 123.123 + sVar = Str$(iVar) + MsgBox strcomp(sVar , Str$(iVar),1) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03120411.xhp b/helpcontent2/source/text/sbasic/shared/03120411.xhp new file mode 100644 index 000000000..34be721d6 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120411.xhp @@ -0,0 +1,76 @@ + + + + + + + InStrRev Function [VBA] + /text/sbasic/shared/03120411.xhp + + + + + + +
+ + InStrRev function + + + +InStrRev Function [VBA] +Returns the position of a string within another string, starting from the right side of the string. +
+ +The InStrRev function returns the position at which the match was found, from the right. If the string was not found, the function returns 0. + + +InStrRev (Text1 As String, Text2 As String [,Start As Long] [, Compare As Integer]) + + +Long + + Text1: The string expression that you want to search. + Text2: The string expression that you want to search for. + Start: Optional numeric expression that marks the position from the left in a string where the search for the specified substring starts. If you omit this parameter, the search starts at the last character of the string. The maximum allowed value is 65535. + Compare: Optional numeric expression that defines the type of comparison. The value of this parameter can be +1: The default value of 1 specifies a text comparison that is not case-sensitive. +0: The value of 0 specifies a binary comparison that is case-sensitive. +To avoid a run-time error, do not set the Compare parameter if the first return parameter is omitted. + + + + +Sub ExamplePosition +Dim sInput As String +Dim iPos As Integer + sInput = "The book is on the table" + iPos = InStrRev(sInput,"the",10,1) ' Returns 1, search is case-insensitive + Print iPos + iPos = InStrRev(sInput,"the",10,0) ' Returns 0, search is case-sensitive + Print iPos +End Sub + + +
+InStr +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03120412.xhp b/helpcontent2/source/text/sbasic/shared/03120412.xhp new file mode 100644 index 000000000..0bf1202fb --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120412.xhp @@ -0,0 +1,57 @@ + + + + + + + StrReverse Function [VBA] + /text/sbasic/shared/03120412.xhp + + + + + + +
+ + StrReverse function + +StrReverse Function [VBA] +Returns the string with the character order reversed. +
+ + + +StrReverse (Text1 As String) + + +String + + Text1: The string expression that you want to reverse the character order. + + + + +Sub ExampleReverse + Print StrReverse("ABCdefGH") ' return "HGfedCBA" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03130000.xhp b/helpcontent2/source/text/sbasic/shared/03130000.xhp new file mode 100644 index 000000000..0dae75465 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03130000.xhp @@ -0,0 +1,50 @@ + + + + + + + + +Other Commands +/text/sbasic/shared/03130000.xhp + + +Sun Microsystems, Inc. + + + +
+Other Commands +This is a list of the functions and the statements that are not included in the other categories. +
+ + + + + + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03130100.xhp b/helpcontent2/source/text/sbasic/shared/03130100.xhp new file mode 100644 index 000000000..5db50f3a1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03130100.xhp @@ -0,0 +1,54 @@ + + + + + + + +Beep Statement +/text/sbasic/shared/03130100.xhp + + +Sun Microsystems, Inc. + + + +
+Beep statement + +Beep Statement +Plays a tone through the computer's speaker. The tone is system-dependent and you cannot modify its volume or pitch. +
+Syntax: + +Beep + + + +Example: + +Sub ExampleBeep + Beep + Beep + Beep +End Sub + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03130500.xhp b/helpcontent2/source/text/sbasic/shared/03130500.xhp new file mode 100644 index 000000000..3bc1f9b10 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03130500.xhp @@ -0,0 +1,130 @@ + + + + + + + Shell Function + /text/sbasic/shared/03130500.xhp + + + + + + +
+ + Shell function + + + +Shell Function +Starts another application and defines the respective window style, if necessary. +
+ +Syntax +Shell (Pathname As String[, Windowstyle As Integer][, Param As String][, bSync]) + +Parameter + +Pathname +Complete path and program name of the program that you want to start. + +Windowstyle +Optional integer expression that specifies the style of the window that the program is executed in. The following values are possible: + + + + + 0 + + + The focus is on the hidden program window. + + + + + 1 + + + The focus is on the program window in standard size. + + + + + 2 + + + The focus is on the minimized program window. + + + + + 3 + + + focus is on the maximized program window. + + + + + 4 + + + Standard size program window, without focus. + + + + + 6 + + + Minimized program window, focus remains on the active window. + + + + + 10 + + + Full-screen display. + + +
+ + +Param +Any string expression that specifies the command line that want to pass. + +bSync +If this value is set to true, the Shell command and all $[officename] tasks wait until the shell process completes. If the value is set to false, the shell returns directly. The default value is false. + + + + + +Example + +Sub ExampleShellForWin + Shell("c:\windows\calc.exe",2) +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03130600.xhp b/helpcontent2/source/text/sbasic/shared/03130600.xhp new file mode 100644 index 000000000..849f00c86 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03130600.xhp @@ -0,0 +1,60 @@ + + + + + + + +Wait Statement +/text/sbasic/shared/03130600.xhp + + +Sun Microsystems, Inc. + + + +
+Wait statement + +Wait Statement +Interrupts the program execution for the amount of time that you specify in milliseconds. +
+ +Wait millisec + + +millisec: Numeric expression that contains the amount of time (in milliseconds) to wait before the program is executed. + + + + +Sub ExampleWait +Dim lTick As Long + lTick = GetSystemTicks() + Wait 2000 + lTick = (GetSystemTicks() - lTick) + MsgBox "" & lTick & " Ticks" ,0,"The pause lasted" +End Sub + +
+ WaitUntil statement +
+ +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03130610.xhp b/helpcontent2/source/text/sbasic/shared/03130610.xhp new file mode 100644 index 000000000..1e68ce7aa --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03130610.xhp @@ -0,0 +1,51 @@ + + + + + + + + WaitUntil Statement + /text/sbasic/shared/03130610.xhp + + + +
+ + WaitUntil statement + +

WaitUntil Statement

+ Interrupts the program execution until the time specified. +
+ + WaitUntil Time + + + Time: A Date and Time expression that contains the date and time to wait before the program is executed. + + + + + + REM Wait until 6:00 PM then call MyMacro. + REM If after 6:00 PM, exit. + Sub ExampleWaitUntil + Dim vTimeschedule As Long + vTimeSchedule = Date() + TimeValue("18:00:00") + If vTimeSchedule < Now() Then Exit Sub + WaitUntil vTimeSchedule + Call MyMacro + End Sub + +
+ Wait statement +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03130700.xhp b/helpcontent2/source/text/sbasic/shared/03130700.xhp new file mode 100644 index 000000000..5e4c4a491 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03130700.xhp @@ -0,0 +1,61 @@ + + + + + + + GetSystemTicks Function + /text/sbasic/shared/03130700.xhp + + + + + +
+ + GetSystemTicks function + + +GetSystemTicks Function +Returns the number of system ticks provided by the operating system. You can use this function to optimize certain processes. +
+ +Syntax: + +GetSystemTicks() + + +Return value: +Long + + + +Example: + +Sub ExampleWait +Dim lTick As Long + lTick = GetSystemTicks() + Wait 2000 + lTick = (GetSystemTicks() - lTick) + MsgBox "" & lTick & " Ticks" ,0,"The pause lasted" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03130800.xhp b/helpcontent2/source/text/sbasic/shared/03130800.xhp new file mode 100644 index 000000000..ff03a4256 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03130800.xhp @@ -0,0 +1,65 @@ + + + + + + + Environ Function + /text/sbasic/shared/03130800.xhp + + + + + + +
+ + Environ function + + + +Environ Function +Returns the value of an environment variable as a string. Environment variables are dependent on the type of operating system that you have. +
+ +Syntax: + +Environ (Environment As String) + + +Return value: +String + +Parameters: +Environment: Environment variable that you want to return the value for. + + + +Example: + +Sub ExampleEnviron +Dim sTemp As String + sTemp=Environ ("TEMP") + If sTemp = "" Then sTemp=Environ("TMP") + MsgBox "'" & sTemp & "'" ,64,"Directory of temporary files:" +End Sub + + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03131000.xhp b/helpcontent2/source/text/sbasic/shared/03131000.xhp new file mode 100644 index 000000000..92a2a316f --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03131000.xhp @@ -0,0 +1,57 @@ + + + + + + + GetSolarVersion Function + /text/sbasic/shared/03131000.xhp + + + + + +
+ + GetSolarVersion function + + +GetSolarVersion Function +Returns the internal number of the current $[officename] version. +
+ +Syntax: + +s = GetSolarVersion + + +Return value: +String + +Example: + +Sub ExampleGetSolarVersion +Dim sSep As String + sSep = GetSolarVersion + MsgBox sSep,64,"Version number of the solar technology" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03131300.xhp b/helpcontent2/source/text/sbasic/shared/03131300.xhp new file mode 100644 index 000000000..264a5b644 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03131300.xhp @@ -0,0 +1,55 @@ + + + + + + + TwipsPerPixelX Function + /text/sbasic/shared/03131300.xhp + + + + + +
+ + TwipsPerPixelX function + + +TwipsPerPixelX Function +Returns the number of twips that represent the width of a pixel. +
+ +Syntax: + +n = TwipsPerPixelX + + +Return value: +Integer + +Example: + +Sub ExamplePixelTwips + MsgBox "" & TwipsPerPixelX() & " Twips * " & TwipsPerPixelY() & " Twips",0,"Pixel size" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03131400.xhp b/helpcontent2/source/text/sbasic/shared/03131400.xhp new file mode 100644 index 000000000..5b4586b02 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03131400.xhp @@ -0,0 +1,55 @@ + + + + + + + TwipsPerPixelY Function + /text/sbasic/shared/03131400.xhp + + + + + +
+ + TwipsPerPixelY function + + +TwipsPerPixelY Function +Returns the number of twips that represent the height of a pixel. +
+ +Syntax: + +n = TwipsPerPixelY + + +Return value: +Integer + +Example: + +Sub ExamplePixelTwips + MsgBox "" & TwipsPerPixelX() & " Twips * " & TwipsPerPixelY() & " Twips",0,"Pixel size" +End Sub + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03131500.xhp b/helpcontent2/source/text/sbasic/shared/03131500.xhp new file mode 100644 index 000000000..a249debd2 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03131500.xhp @@ -0,0 +1,49 @@ + + + + + + + + CreateUnoStruct Function + /text/sbasic/shared/03131500.xhp + + + Sun Microsystems, Inc. + + + +
+ CreateUnoStruct function + +

CreateUnoStruct Function

+ Creates an instance of a Uno structure type. +
+ + oStruct = CreateUnoStruct( Uno type name ) + + + oStruct = CreateUnoStruct( "com.sun.star.beans.Property" ) + + Or use the following structure for your statement: + + Dim oStruct as new com.sun.star.beans.Property + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03131600.xhp b/helpcontent2/source/text/sbasic/shared/03131600.xhp new file mode 100644 index 000000000..b0c499b8c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03131600.xhp @@ -0,0 +1,85 @@ + + + + + + + CreateUnoService Function + /text/sbasic/shared/03131600.xhp + + + + +
+ +CreateUnoService function +API;FilePicker +API;FunctionAccess + + +

CreateUnoService Function

+Instantiates a Uno service with the ProcessServiceManager. +
+ + +oService = CreateUnoService( Uno service name ) + +For a list of available services, go to: https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star.html + + + +Calc functions;API Service + +Calling Calc functions in Basic: +
+ + REM The code below does not work for add-in functions, which have a different calling procedure. + Function MyVlook(item, InRange As Object, FromCol As Integer) + Dim oService As Object + oService = createUnoService("com.sun.star.sheet.FunctionAccess") + REM Always use the function English name + MyVlook = oService.callFunction("VLOOKUP",Array(item, InRange, FromCol, True)) + End Function + +
+ +oIntrospection = CreateUnoService( "com.sun.star.beans.Introspection" ) + +filepicker;API service + +The following code uses a service to open a file open dialog: + +Sub Main + fName = FileOpenDialog ("Please select a file") + Print "file chosen: "+fName +End Sub + +Function FileOpenDialog(title As String) As String + filepicker = createUnoService("com.sun.star.ui.dialogs.FilePicker") + filepicker.Title = title + filepicker.execute() + files = filepicker.getFiles() + FileOpenDialog=files(0) +End Function + +
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/03131700.xhp b/helpcontent2/source/text/sbasic/shared/03131700.xhp new file mode 100644 index 000000000..e04eac85d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03131700.xhp @@ -0,0 +1,50 @@ + + + + + + + +GetProcessServiceManager Function +/text/sbasic/shared/03131700.xhp + + +Sun Microsystems, Inc. + + + +
+GetProcessServiceManager function +ProcessServiceManager + +GetProcessServiceManager Function +Returns the ProcessServiceManager (central Uno ServiceManager). +
+This function is required when you want to instantiate a service using CreateInstanceWithArguments. + +oServiceManager = GetProcessServiceManager() + + + oServiceManager = GetProcessServiceManager() + oIntrospection = oServiceManager.createInstance("com.sun.star.beans.Introspection"); + ' this is the same as the following statement: + oIntrospection = CreateUnoService("com.sun.star.beans.Introspection") + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03131800.xhp b/helpcontent2/source/text/sbasic/shared/03131800.xhp new file mode 100644 index 000000000..26f71a677 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03131800.xhp @@ -0,0 +1,54 @@ + + + + + + + +CreateUnoDialog Function +/text/sbasic/shared/03131800.xhp + + +Sun Microsystems, Inc. + + + + +
+ + CreateUnoDialog function + +CreateUnoDialog Function +Creates a Basic Uno object that represents a Uno dialog control during Basic runtime. +
+Dialogs are defined in the dialog libraries. To display a dialog, a "live" dialog must be created from the library. +See Examples. + +CreateUnoDialog( oDlgDesc ) + + + ' Get dialog description from the dialog library + oDlgDesc = DialogLibraries.Standard.Dialog1 + ' Generate "live" dialog + oDlgControl = CreateUnoDialog( oDlgDesc ) + ' display "live" dialog + oDlgControl.execute + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03131900.xhp b/helpcontent2/source/text/sbasic/shared/03131900.xhp new file mode 100644 index 000000000..a91107a43 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03131900.xhp @@ -0,0 +1,64 @@ + + + + + + + +GlobalScope +/text/sbasic/shared/03131900.xhp + + +Sun Microsystems, Inc. + + + +
+GlobalScope specifier +library systems +Library container +GlobalScope +API; BasicLibraries +API; DialogLibraries +BasicLibraries; library container +DialogLibraries; library container + +

GlobalScope specifier

+To manage personal or shared library containers (%PRODUCTNAME Macros or My Macros) from within a document, use the GlobalScope specifier. +
+
+ Basic source code and dialogs are organized in library containers. Libraries can contain modules and dialogs. +
+

In Basic:

+Basic libraries and modules can be managed with the BasicLibraries object. Libraries can be searched, explored and loaded on request. Monitoring Documents Events illustrates %PRODUCTNAME library loading. +

In dialogs:

+Dialog libraries and dialogs can be managed with the DialogLibraries object. Opening a Dialog With Basic illustrates how to display %PRODUCTNAME shared dialogs. +BasicLibraries and DialogLibraries containers exist at application level and within every document. Document's library containers do not need the GlobalScope specifier to be managed. If you want to call a global library container (located in %PRODUCTNAME Macros or My Macros) from within a document, you must use the GlobalScope specifier. + +GlobalScope specifier + +Example in the document Basic + + ' calling Dialog1 in the document library Standard + oDlgDesc = DialogLibraries.Standard.Dialog1 + ' calling Dialog2 in the application library Library1 + oDlgDesc = GlobalScope.DialogLibraries.Library1.Dialog2 + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03132000.xhp b/helpcontent2/source/text/sbasic/shared/03132000.xhp new file mode 100644 index 000000000..52664aaef --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03132000.xhp @@ -0,0 +1,131 @@ + + + + + + + CreateUnoListener Function + /text/sbasic/shared/03132000.xhp + + + + + + +
+ + CreateUnoListener function + + + +CreateUnoListener Function +Creates a Listener instance. +
+Many Uno interfaces let you register listeners on a special listener interface. This allows you to listen for specific events and call up the appropriate listener method. The CreateUnoListener function waits for the called listener interface and then passes the interface an object that the interface supports. This object is then passed to the method to register the listener. + +oListener = CreateUnoListener( Prefixname, ListenerInterfaceName ) + +The following example is based on a Basic library object. + +Dim oListener +oListener = CreateUnoListener( "ContListener_","com.sun.star.container.XContainerListener" ) + +The CreateUnoListener method requires two parameters. The first is a prefix and is explained in detail below. The second parameter is the fully qualified name of the Listener interface that you want to use. +The Listener must then be added to the Broadcaster Object. This is done by calling the appropriate method for adding a Listener. These methods always follow the pattern "addFooListener", where "Foo" is the Listener Interface Type, without the 'X'. In this example, the addContainerListener method is called to register the XContainerListener: + +Dim oLib +oLib = BasicLibraries.Library1 ' Library1 must exist! +oLib.addContainerListener( oListener ) ' Register the listener + +The Listener is now registered. When an event occurs, the corresponding Listener calls the appropriate method from the com.sun.star.container.XContainerListener Interface. +The prefix calls registered Listeners from Basic-subroutines. The Basic run-time system searches for Basic-subroutines or functions that have the name "PrefixListenerMethode" and calls them when found. Otherwise, a run-time error occurs. +In this example, the Listener-Interface uses the following methods: + + + + disposing: + + + Listener base interface (com.sun.star.lang.XEventListener): base interface for all Listener Interfaces + + + elementInserted: + + + Method of the com.sun.star.container.XContainerListener interface + + + elementRemoved: + + + Method of the com.sun.star.container.XContainerListener interface + + + elementReplaced: + + + Method of the com.sun.star.container.XContainerListener interface + +In this example, the prefix is ContListener_. The following subroutines must therefore be implemented in Basic: + + + + ContListener_disposing + + + ContListener_elementInserted + + + ContListener_elementRemoved + + + ContListener_elementReplaced + +An event structure type that contains information about an event exists for every Listener type. When a Listener method is called, an instance of this event is passed to the method as a parameter. Basic Listener methods can also call these event objects, so long as the appropriate parameter is passed in the Sub declaration. For example: + +Sub ContListener_disposing( oEvent ) + MsgBox "disposing" + MsgBox oEvent.Dbg_Properties +End Sub + +Sub ContListener_elementInserted( oEvent ) + MsgBox "elementInserted" + MsgBox oEvent.Dbg_Properties +End Sub + +Sub ContListener_elementRemoved( oEvent ) + MsgBox "elementRemoved" + MsgBox oEvent.Dbg_Properties +End Sub + +Sub ContListener_elementReplaced( oEvent ) + MsgBox "elementReplaced" + MsgBox oEvent.Dbg_Properties +End Sub + +You do not need to include the parameter of an event object if the object is not used: + +' Minimal implementation of Sub disposing +Sub ContListener_disposing +End Sub + +Listener methods must always be implemented to avoid Basic run-time errors. + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03132100.xhp b/helpcontent2/source/text/sbasic/shared/03132100.xhp new file mode 100644 index 000000000..c95d845ff --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03132100.xhp @@ -0,0 +1,56 @@ + + + + + + + + GetGuiType Function + /text/sbasic/shared/03132100.xhp + + + +
+GetGuiType function + +

GetGuiType Function

+ Returns a numerical value that specifies the graphical user interface. +
+ This function is only provided for downward compatibility to previous versions. The return value is not defined in client-server environments. + Syntax: + +GetGUIType() + + Return value: + Integer + Return values: + 1: Windowsremoved 3: Mac OS, see i95717 +4: UNIX + Example: + + Sub ExampleEnvironment + MsgBox GetGUIType + End Sub + +
+ +
+ +
+ diff --git a/helpcontent2/source/text/sbasic/shared/03132200.xhp b/helpcontent2/source/text/sbasic/shared/03132200.xhp new file mode 100644 index 000000000..eb96a9964 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03132200.xhp @@ -0,0 +1,49 @@ + + + + + + ThisComponent Object + /text/sbasic/shared/03132200.xhp + + + +
+ + ThisComponent object + components;addressing + +ThisComponent Object +Addresses the active component whose properties can be read and set, and whose methods can be called. ThisComponent is used in Basic, where it represents the current document. Properties and methods available through ThisComponent depend on the document type.see i60932 +
+ +ThisComponent + + +Sub Main +' updates the "Table of Contents" in a text doc +Dim allindexes, index As Object + allindexes = ThisComponent.getDocumentIndexes() + index = allindexes.getByName("Table of Contents1") + ' use the default name for Table of Contents and a 1 + index.update() +End Sub + + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03132300.xhp b/helpcontent2/source/text/sbasic/shared/03132300.xhp new file mode 100644 index 000000000..e405a5a3e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03132300.xhp @@ -0,0 +1,47 @@ + + + + + + + +CreateUnoValue Function +/text/sbasic/shared/03132300.xhp + + +Sun Microsystems, Inc. + + + +
+CreateUnoValue function + +CreateUnoValue Function +Returns an object that represents a strictly typed value referring to the Uno type system. +
+This object is automatically converted to an Any of the corresponding type when passed to Uno. The type must be specified by its fully qualified Uno type name. +The $[officename] API frequently uses the Any type. It is the counterpart of the Variant type known from other environments. The Any type holds one arbitrary Uno type and is used in generic Uno interfaces. + +oUnoValue = CreateUnoValue( "[]byte", MyBasicValue ) ' to get a byte sequence. +If CreateUnoValue cannot be converted to the specified Uno type, and error occurs. For the conversion, the TypeConverter service is used. +This function is intended for use in situations where the default Basic to Uno type converting mechanism is insufficient. This can happen when you try to access generic Any based interfaces, such as XPropertySet::setPropertyValue( Name, Value ) or X???Container::insertBy???( ???, Value ), from $[officename] Basic. The Basic runtime does not recognize these types as they are only defined in the corresponding service. +In this type of situation, $[officename] Basic chooses the best matching type for the Basic type that you want to convert. However, if the wrong type is selected, an error occurs. You use the CreateUnoValue() function to create a value for the unknown Uno type. +You can also use this function to pass non-Any values, but this is not recommend. If Basic already knows the target type, using the CreateUnoValue() function will only lead to additional converting operations that slow down the Basic execution. + +
diff --git a/helpcontent2/source/text/sbasic/shared/03132400.xhp b/helpcontent2/source/text/sbasic/shared/03132400.xhp new file mode 100644 index 000000000..32c3b0573 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03132400.xhp @@ -0,0 +1,52 @@ + + + + + + + CreateObject Function + /text/sbasic/shared/03132400.xhp + + + + +
+ + CreateObject function + +CreateObject Function +Creates a UNO object. On Windows, can also create OLE objects.see i70942 +This method creates instances of the type that is passed as parameter. +
+ +oObj = CreateObject( type ) + + +Type address + Name1 As String + City As String +End Type + +Sub main + myaddress = CreateObject("address") + MsgBox IsObject(myaddress) +End Sub + + +
diff --git a/helpcontent2/source/text/sbasic/shared/03132500.xhp b/helpcontent2/source/text/sbasic/shared/03132500.xhp new file mode 100644 index 000000000..f67ad0589 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03132500.xhp @@ -0,0 +1,41 @@ + + + + + + + + +GetDefaultContext Function +/text/sbasic/shared/03132500.xhp + + +GetDefaultContext function + + + +
+GetDefaultContext function + +GetDefaultContext Function +Returns the default context of the process service factory, if existent, else returns a null reference. +
+This function returns the default component context to be used, if instantiating services via XmultiServiceFactory. See the Professional UNO chapter in the Developer's Guide on api.libreoffice.org for more information. + +
diff --git a/helpcontent2/source/text/sbasic/shared/03140000.xhp b/helpcontent2/source/text/sbasic/shared/03140000.xhp new file mode 100644 index 000000000..2b7426f53 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140000.xhp @@ -0,0 +1,71 @@ + + + + + + + DDB Function [VBA] + /text/sbasic/shared/03140000.xhp + + + + + + +
+ + DDB function + + + +DDB Function [VBA] +Returns the depreciation of an asset for a specified period using the arithmetic-declining method. +
+ + + +DDB(Cost As Double, Salvage As Double, Life as Double, Period as Double, [Factor as Variant]) + + +Double + +Cost fixes the initial cost of an asset. +Salvage fixes the value of an asset at the end of its life. +Life is the number of periods (for example, years or months) defining how long the asset is to be used. +Period states the period for which the value is to be calculated. +Factor (optional) is the factor by which depreciation decreases. If a value is not entered, the default is factor 2. +Use this form of depreciation if you require a higher initial depreciation value as opposed to linear depreciation. The depreciation value gets less with each period and is usually used for assets whose value loss is higher shortly after purchase (for example, vehicles, computers). Please note that the book value will never reach zero under this calculation type. + + + + +Sub ExampleDDB + Dim ddb_yr1 As Double + ddb_yr1 = DDB(75000,1,60,12,2) + Print ddb_yr1 ' returns 1,721.81 currency units. +End Sub + + +
+DDB function in CALC + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03140001.xhp b/helpcontent2/source/text/sbasic/shared/03140001.xhp new file mode 100644 index 000000000..1731bcc97 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140001.xhp @@ -0,0 +1,72 @@ + + + + + + + FV Function [VBA] + /text/sbasic/shared/03140001.xhp + + + + + + +
+ + FV function + + + +FV Function [VBA] +Returns the future value of an investment based on periodic, constant payments and a constant interest rate (Future Value). +
+ + + +FV(Rate as Double, NPer as Double, Pmt as Double, [PV as Variant], [Due as Variant]) + + +Double + +Rate is the periodic interest rate. +NPer is the total number of periods (payment period). +Pmt is the annuity paid regularly per period. +PV (optional) is the (present) cash value of an investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + +Sub ExampleFV + Dim myFV As Double + myFV = =FV(0.04, 2, 750, 2500) + Print myFV ' returns 4234.00 currency units. The value at the end of the investment is 4234.00 currency units. +End Sub + + +
+FV function in CALC + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03140002.xhp b/helpcontent2/source/text/sbasic/shared/03140002.xhp new file mode 100644 index 000000000..9b47710a9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140002.xhp @@ -0,0 +1,73 @@ + + + + + + + IPmt Function [VBA] + /text/sbasic/shared/03140002.xhp + + + + + + +
+ + IPmt function + + + +IPmt Function [VBA] +Calculates the periodic amortizement for an investment with regular payments and a constant interest rate. +
+ + + +IPmt(Rate as Double, Per as Double, NPer as Double, PV as Double, [FV as Variant], [Due as Variant]) + + +Double + +Rate is the periodic interest rate. +Per is the period, for which the compound interest is calculated. Period=NPER if compound interest for the last period is calculated. +NPer is the total number of periods, during which annuity is paid. +PV is the present cash value in sequence of payments. +FV (optional) is the desired value (future value) at the end of the periods. +Due (optional) is the due date for the periodic payments. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + +Sub ExampleIPmt + Dim myIPmt As Double + myIPmt = IPmt(0.05,5,7,15000) + Print myIPmt ' returns -352.97 currency units. The compound interest during the fifth period (year) is 352.97 currency units. +End Sub + + +
+IPMT function in CALC + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03140003.xhp b/helpcontent2/source/text/sbasic/shared/03140003.xhp new file mode 100644 index 000000000..8b1707e22 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140003.xhp @@ -0,0 +1,73 @@ + + + + + + + IRR Function [VBA] + /text/sbasic/shared/03140003.xhp + + + + + + +
+ + IRR function + + + +IRR Function [VBA] +Calculates the internal rate of return for an investment. +
+ + + +IRR(Values() as Double , [Guess as Variant]) + + +Double + +Values(): The array of values of the cash-flow. The values represent cash flow values at regular intervals, at least one value must be negative (payments), and at least one value must be positive (income). +Guess An initial estimate at what the IRR will be. + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExampleIRR + Dim cashFlow(0 to 3) As Double + cashFlow(0) = -10000 + cashFlow(1) = 3500 + cashFlow(2) = 7600 + cashFlow(3) = 1000 + irrValue = IRR(cashFlow) * 100 + Print irrValue ' returns 11.3321028236252 . The internal rate of return of the cash flow. +End Sub + + +
+IRR function in CALC + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03140004.xhp b/helpcontent2/source/text/sbasic/shared/03140004.xhp new file mode 100644 index 000000000..18d65dd5a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140004.xhp @@ -0,0 +1,74 @@ + + + + + + + MIRR Function [VBA] + /text/sbasic/shared/03140004.xhp + + + + + + +
+ + MIRR function + + + +MIRR Function [VBA] +Calculates the modified internal rate of return of a series of investments. +
+ + + +MIRR(Values() as Double, Investment as Double, ReinvestRate as Double) + + +Double + +Values(): An array of cash flows, representing a series of payments and income, where negative values are treated as payments and positive values are treated as income. This array must contain at least one negative and at least one positive value. +Investment: is the rate of interest of the investments (the negative values of the array). +ReinvestRate: the rate of interest of the reinvestment (the positive values of the array). + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExampleMIRR + Dim cashFlow(0 to 3) As Double + cashFlow(0) = -5 + cashFlow(1) = 10 + cashFlow(2) = 15 + cashFlow(3) = 8 + mirrValue = MIRR(cashFlow,0.5,0.1) * 100 + Print mirrValue ' returns 94.16. The modified internal rate of return of the cash flow. +End Sub + + +
+MIRR function in CALC + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03140005.xhp b/helpcontent2/source/text/sbasic/shared/03140005.xhp new file mode 100644 index 000000000..488d46ec9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140005.xhp @@ -0,0 +1,74 @@ + + + + + + + NPer Function [VBA] + /text/sbasic/shared/03140005.xhp + + + + + + +
+ + NPer function + + + +NPer Function [VBA] +Calculates the number of periods for a loan or investment. +
+ + + +NPer (Rate as Double, Pmt as Double, PV as Double, [FV as Variant], [Due as Variant]) + + +Double + +Rate is the periodic interest rate. +Pmt is the annuity paid regularly per period. +PV is the (present) cash value of an investment. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExampleNPer + Dim period As Double + period = NPer( 0.06, 153.75, 2600) + Print period ' returns -12,02. The payment period covers 12.02 periods. +End Sub + + +
+NPER function in CALC + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03140006.xhp b/helpcontent2/source/text/sbasic/shared/03140006.xhp new file mode 100644 index 000000000..94b4b9bbd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140006.xhp @@ -0,0 +1,77 @@ + + + + + + + NPV Function [VBA] + /text/sbasic/shared/03140006.xhp + + + + + + +
+ + NPV function + + + +NPV Function [VBA] +Calculates the Net Present Value of an investment, based on a supplied discount rate, and a series of deposits and withdrawals. +
+ + + +NPV (Rate as Double, Values() as Double) + + +Double + +Rate is the discount rate for a period. +Values() is an array that represent deposits (positive values) or withdrawals (negative values). + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExampleNPV + Dim r As Double + Dim pValues(5) as Double + pValues(0) = 100 + pValues(1) = 100 + pValues(2) = 100 + pValues(3) = -300 + pValues(4) = 100 + pValues(5) = 100 + r = 0.06 + p = NPV( r, pValues) + Print p ' returns 174,894967305331 +End Sub + + +
+NPV function in CALC + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03140007.xhp b/helpcontent2/source/text/sbasic/shared/03140007.xhp new file mode 100644 index 000000000..9d2e7001e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140007.xhp @@ -0,0 +1,76 @@ + + + + + + + Pmt Function [VBA] + /text/sbasic/shared/03140007.xhp + + + + + + +
+ + Pmt function + + + +Pmt Function [VBA] +Calculates the constant periodic payments for a loan or investment. +
+ + + +Pmt( Rate as Double, NPer as Double , PV as Double , [FV as Variant], [Due as Variant] ) + + +Double + +Rate is the periodic interest rate. +NPer is the total number of periods, during which annuity is paid. +PV is the (present) cash value of an investment. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + +REM ***** BASIC ***** +Option VBASUPPORT 1 +' Calculate the monthly payments to a loan that is to be paid in full over 6 years. +' Interest is 10% per year and payments are made at the end of the month. +Sub ExamplePmt + Dim myPmt As Double + myPmt = Pmt( 0.1/12, 72, 100000 ) + print MyPmt 'is calculated to be -1852,58377757705 +End Sub + + +
+PMT function in CALC + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03140008.xhp b/helpcontent2/source/text/sbasic/shared/03140008.xhp new file mode 100644 index 000000000..c9694aa3e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140008.xhp @@ -0,0 +1,82 @@ + + + + + + + PPmt Function [VBA] + /text/sbasic/shared/03140008.xhp + + + + + + +
+ + PPmt function + + + +PPmt Function [VBA] +Returns for a given period the payment on the principal for an investment that is based on periodic and constant payments and a constant interest rate. +
+ + + +Pmt( Rate as Double, Per as Double, NPer as Double, PV as Double, [FV as Variant], [Due as Variant] ) + + +Double + +Rate is the periodic interest rate. +Per The period number for which you want to calculate the principal payment (must be an integer between 1 and Nper). +NPer is the total number of periods, during which annuity is paid. +PV is the (present) cash value of an investment. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExamplePPmt +' Calculate the principal payments during months 4 & 5, for a loan that is to be paid in full +' over 6 years. Interest is 10% per year and payments are made at the end of the month. +Dim ppMth4 As Double +Dim ppMth5 As Double +' Principal payment during month 4: +ppMth4 = PPmt( 0.1/12, 4, 72, 100000 ) +print ppMth4 ' ppMth4 is calculated to be -1044,94463903636. +' Principal payment during month 5: +ppMth5 = PPmt( 0.1/12, 5, 72, 100000 ) +print ppMth5' ppMth5 is calculated to be -1053,65251102833. +End Sub + + +
+PPMT function in CALC + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03140009.xhp b/helpcontent2/source/text/sbasic/shared/03140009.xhp new file mode 100644 index 000000000..2e8620daa --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140009.xhp @@ -0,0 +1,76 @@ + + + + + + + PV Function [VBA] + /text/sbasic/shared/03140009.xhp + + + + + + +
+ + PV function + + + +PV Function [VBA] +Returns the Present Value of an investment resulting from a series of regular payments. +
+ + + +Pmt( Rate as Double, NPer as Double, Pmt as Double, [FV as Variant], [Due as Variant] ) + + +Double + +Rate is the periodic interest rate. +NPer is the total number of periods, during which annuity is paid. +Pmt is the regular payment made per period. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExamplePV +' Calculate the present value of an annuity that pays $1,000 per month over 6 years. +' Interest is 10% per year and each payment is made at the end of the month. +Dim pv1 As Double +pv1 = PV( 0.1/12, 72, -1000 ) +print pv1 ' pv1 is calculated to be 53978,6654781073. +End Sub + + +
+PV function in CALC + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03140010.xhp b/helpcontent2/source/text/sbasic/shared/03140010.xhp new file mode 100644 index 000000000..f76bf540e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140010.xhp @@ -0,0 +1,77 @@ + + + + + + + Rate Function [VBA] + /text/sbasic/shared/03140010.xhp + + + + + + +
+ + Rate function + + + +Rate Function [VBA] +Returns the interest rate of a loan or an investment. +
+ + + +Rate( NPer as Double, Pmt as Double, PV as Double [FV as Variant], [Due as Variant], [Guess as Variant] ) + + +Double + +NPer is the total number of periods, during which annuity is paid. +Pmt is the regular payment made per period. +PV is the present value of the loan / investment. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. +Guess(optional) determines the estimated value of the interest with iterative calculation. + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExampleRate +' Calculate the interest rate required to pay off a loan of $100,000 over +' 6 years, with payments of $1,500, due at the end of each month. + Dim mRate As Double + mRate = Rate( 72, -1500, 100000 ) + print mRate' mRate is calculated to be 0.00213778025343334 +End sub + + +
+RATE function in CALC + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03140011.xhp b/helpcontent2/source/text/sbasic/shared/03140011.xhp new file mode 100644 index 000000000..6864384ba --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140011.xhp @@ -0,0 +1,72 @@ + + + + + + + SLN Function [VBA] + /text/sbasic/shared/03140011.xhp + + + + + + +
+ + SLN function + + + +SLN Function [VBA] +Returns the straight-line depreciation of an asset for one period. The amount of the depreciation is constant during the depreciation period. +
+ + + +SLN (Cost as Double, Salvage as Double, Life as Double) + + +Double + +Cost is the initial cost of an asset. +Salvage is the value of an asset at the end of the depreciation. +Life is the depreciation period determining the number of periods in the depreciation of the asset. + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExampleSLN +REM Calculate the yearly depreciation of an asset that cost $10,000 at +REM the start of year 1, and has a salvage value of $1,000 after 5 years. +Dim y_dep As Double +y_dep = SLN( 10000, 1000, 6 ) +print y_dep ' returns 1500. +End Sub + + +
+SLN function in CALC + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03140012.xhp b/helpcontent2/source/text/sbasic/shared/03140012.xhp new file mode 100644 index 000000000..9ad42e26b --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140012.xhp @@ -0,0 +1,74 @@ + + + + + + + SYD Function [VBA] + /text/sbasic/shared/03140012.xhp + + + + + + +
+ + SYD function + + + +SYD Function [VBA] +Returns the arithmetic-declining depreciation rate. +
+ + + +SYD (Cost as Double, Salvage as Double, Life as Double, Period as Double) + + +Double + +Cost is the initial cost of an asset. +Salvage is the value of an asset at the end of the depreciation. +Life is the depreciation period determining the number of periods in the depreciation of the asset. +Period is the period number for which you want to calculate the depreciation. + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExampleSYD +REM Calculate the yearly depreciation of an asset that cost $10,000 at +REM the start of year 1, and has a salvage value of $1,000 after 5 years. +Dim syd_yr1 As Double +REM Calculate the depreciation during year 1. +syd_yr1 = SYD( 10000, 1000, 5, 1 ) +print syd_yr1 ' syd_yr1 is now equal to 3000. +End Sub + + +
+SYD function in CALC + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/03150000.xhp b/helpcontent2/source/text/sbasic/shared/03150000.xhp new file mode 100644 index 000000000..6ad2ca1a6 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03150000.xhp @@ -0,0 +1,140 @@ + + + + + + + FormatDateTime Function [VBA] + /text/sbasic/shared/03150000.xhp + + + + + +
+ + FormatDateTime function + + + FormatDateTime Function [VBA] + Applies a date and/or time format to a date expression and returns the result as a string. +
+ + + + FormatDateTime (DateExpression as Date [, NamedFormat as Integer]) + + + String + + DateExpression: The date expression to be formatted. + NamedFormat: An optional vbDateTimeFormat enumeration specifying the format that is to be applied to the date and time expression. If omitted, the value vbGeneralDate is used. + Date and Time formats (vbDateTimeFormat enumeration) + + + + Named Constant + + + Value + + + Description + + + + + vbGeneralDate + + + 0 + + + Displays a date and/or time as defined in your system's General Date setting. If a date only, no time is displayed; If a time only, no date is displayed. + + + + + vbLongDate + + + 1 + + + Display a date using the long date format specified in your computer's regional settings. + + + + + vbShortDate + + + 2 + + + Display a date using the short date format specified in your computer's regional settings. + + + + + vbLongTime + + + 3 + + + Displays a time as defined in your system's Long Time settings. + + + + + vbShortTime + + + 4 + + + Display a time using the 24-hour format (hh:mm). + + +
+ + + + + + REM ***** BASIC ***** + Option VBASupport 1 + Sub DateFormat + Dim d as Date + d = ("1958-01-29 00:25") + msgbox("General date format : " & FormatDateTime(d)) + msgbox("Long date format : " & FormatDateTime(d,vbLongDate)) + msgbox("Short date format : " & FormatDateTime(d,vbShortDate)) + msgbox("Long time format : " & FormatDateTime(d,3)) + msgbox("Short time format : " & FormatDateTime(d,vbShortTime)) + End Sub + + +
+ +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03150001.xhp b/helpcontent2/source/text/sbasic/shared/03150001.xhp new file mode 100644 index 000000000..d3e0e20c8 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03150001.xhp @@ -0,0 +1,173 @@ + + + + + + + WeekdayName Function [VBA] + /text/sbasic/shared/03150001.xhp + + + + + + +
+ + WeekdayName function + + + WeekdayName Function [VBA] + The WeekdayName function returns the weekday name of a specified day of the week. +
+ + + + WeekdayName(Weekday as Integer [,Abbreviate as Boolean [,FirstDayofWeek as Integer]]) + + + String + + Weekday: Value from 1 to 7, Mon­day to Sun­day, whose Week Day Name need to be calculated. + Abbreviate: Optional. A Boolean value that indicates if the weekday name is to be abbreviated. + FirstDayofWeek: Optional. Specifies the first day of the week. + First day of Week: + + + + Named constant + + + Value + + + Description + + + + + vbUseSystemDayOfWeek + + + 0 + + + Use National Language Support (NLS) API setting + + + + + vbSun­day + + + 1 + + + Sun­day (default) + + + + + vbMonday + + + 2 + + + Monday + + + + + vbTuesday + + + 3 + + + Tuesday + + + + + vbWednesday + + + 4 + + + Wednesday + + + + + vbThursday + + + 5 + + + Thursday + + + + + vbFriday + + + 6 + + + Friday + + + + + vbSaturday + + + 7 + + + Saturday + + +
+ + + + None + + + REM ***** BASIC ***** + Option VBASupport 1 + Sub Example_WeekdayName + Dim tgf as Integer + tgf = 6 + print tgf &" "& WeekdayName(tgf,False,vbSunday) + End Sub + + +
+ + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03150002.xhp b/helpcontent2/source/text/sbasic/shared/03150002.xhp new file mode 100644 index 000000000..5516ab45c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03150002.xhp @@ -0,0 +1,66 @@ + + + + + + + MonthName Function [VBA] + /text/sbasic/shared/03150002.xhp + + + + +
+ + MonthName function + + + MonthName Function [VBA] + The MonthName function returns the localized month name of a specified month number. +
+ + + + MonthName(Month as Integer [,Abbreviate as Boolean]) + + + String + + Month: Value from 1 to 12, January to December, whose localized month name need to be returned. + Abbreviate: Optional. A Boolean value that indicates if the month name is to be abbreviated. + + + + + + REM ***** BASIC ***** + Option VBASupport 1 + Sub Example_MonthName + Dim mBirthday as Integer + mBirthday = 1 + print mBirthday &" "& MonthName(mBirthday,False) + End Sub + + +
+ +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03160000.xhp b/helpcontent2/source/text/sbasic/shared/03160000.xhp new file mode 100644 index 000000000..443b07229 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03160000.xhp @@ -0,0 +1,77 @@ + + + + + + + Input Function [VBA] + /text/sbasic/shared/03160000.xhp + + + + + + +
+ + Input function + + + + Input Function [VBA] + Returns the open stream of an Input or Binary file (String). +
+ + + + Input( Number as Integer, [# ] FileNumber as Integer) + + + String + + Number: Required. Numeric expression specifying the number of characters to return. + #: Optional. + FileNumber: Required. Any valid file number. + + + + + + + + REM ***** BASIC ***** + Option VBASupport 1 + Sub Example_Input + Dim MyData + Open "MyDataFile.txt" For Input As #1 + Do While Not EOF(1) + MyData = Input(1, #1) + Print MyData + Loop + Close #1 + End Sub + + +
+ Input# statement + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03170000.xhp b/helpcontent2/source/text/sbasic/shared/03170000.xhp new file mode 100644 index 000000000..b6ac5a4ff --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03170000.xhp @@ -0,0 +1,71 @@ + + + + + + + Round Function [VBA] + /text/sbasic/shared/03170000.xhp + + + + + +
+ + Round function + + Round Function [VBA] + The Round function returns a number rounded to a specified number of digits. +
+ + + + Round( expression as Double [,numdecimalplaces as Integer] ) + + + Double + + expression: Required. The numeric expression to be rounded. + numdecimalplaces: Optional. Specifies how many places to the right of the decimal are included in the rounding. Default is 0. + + + + + + REM ***** BASIC ***** + Option VBASupport 1 + Sub Example_Round + Dim r + r = Pi + print r ' 3,14159265358979 + print Round(r, 5) ' 3,14159 + r = exp(1) + print r ' 2,71828182845904 + print Round(r) ' 3 + End Sub + + +
+ Calc ROUND function + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/03170010.xhp b/helpcontent2/source/text/sbasic/shared/03170010.xhp new file mode 100644 index 000000000..cf582c729 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03170010.xhp @@ -0,0 +1,118 @@ + + + + + + + FormatNumber Function [VBA] + /text/sbasic/shared/03170010.xhp + + + +
+ + + FormatNumber function + + FormatNumber [VBA] + Returns a string with a number formatting applied to a numeric expression. +
+ + + FormatNumber( expression, numDigitsAfterDecimal as Integer, includeLeadingDigit as Integer,
useParensForNegativeNumbers as Integer, groupDigits as Integer )
+ + String + + + + expression: Required. The numeric expression to be formatted. + + numDigitsAfterDecimal: Optional. A numeric value specifying the number of digits that should be displayed after the decimal. If omitted, it defaults to the value -1, meaning that the default settings for user interface locale should be used. + + includeLeadingDigit: Optional. A vbTriState enumeration value, specifying whether a leading zero should be displayed for fractional values. + + + + vbTrue or -1: Display a leading zero. + + + vbFalse or 0: Do not display leading zeros. + + + vbUseDefaults or -2: Use the user interface locale settings. This is the default when omitted. + + + useParensForNegativeNumbers: Optional. A vbTriState enumeration value specifying whether negative numbers should be encased in parenthesis. + + + vbTrue or -1: Use parenthesis for negative numbers. + + + vbFalse or 0: Do not display parenthesis. + + + vbUseDefaults or -2: Same as vbFalse. This is the default when omitted. + + + + groupDigits: Optional. A vbTriState enumeration value specifying the number should be grouped (into thousands, etc.), using the group delimiter that is specified on the system's regional settings. + + + + vbTrue or -1: Group digits. + + + vbFalse or 0: Do not group digits. + + + vbUseDefaults or -2: Same as vbFalse. This is the default when omitted. + + + + + + + Sub TestFormatNumeber + testName = "Test 1: positive, 2 decimals" + str2 = "12.20" + str1 = FormatNumber("12.2", 2, vbFalse, vbFalse, vbFalse) + msgbox( "FormatNumber returned: " + str1 + ", Expected: " + str2) + + testName = "Test 2: negative, 20 decimals, use leading zero" + str2 = "-0.20000000000000000000" + str1 = FormatNumber("-.2", 20, vbTrue, vbFalse, vbFalse) + msgbox( "FormatNumber returned: " + str1 + ", Expected: " + str2) + + testName = "Test 3: negative, 20 decimals, no leading zero" + str2 = "-.20000000000000000000" + str1 = FormatNumber("-0.2", 20, vbFalse, vbFalse, vbFalse) + msgbox( "FormatNumber returned: " + str1 + ", Expected: " + str2) + + testName = "Test 4: negative, no leading zero, use parens" + str2 = "(.20)" + str1 = FormatNumber("-0.2", -1, vbFalse, vbTrue, vbFalse) + msgbox( "FormatNumber returned: " + str1 + ", Expected: " + str2) + + testName = "Test 5: negative, default leading zero, use parens" + str2 = "(0.20)" + str1 = FormatNumber("-0.2", -1, vbUseDefault, vbTrue, vbFalse) + msgbox( "FormatNumber returned: " + str1 + ", Expected: " + str2) + + testName = "Test 6: group digits" + str2 = "-12,345,678.00" + str1 = FormatNumber("-12345678", -1, vbUseDefault, vbUseDefault, vbTrue) + msgbox( "FormatNumber returned: " + str1 + ", Expected: " + str2) + End Sub + +
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/05060700.xhp b/helpcontent2/source/text/sbasic/shared/05060700.xhp new file mode 100644 index 000000000..b4d2c8b37 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/05060700.xhp @@ -0,0 +1,372 @@ + + + + + + + + +Macro +/text/sbasic/shared/05060700.xhp + + +Sun Microsystems, Inc. + + + +
+events;linked to objects + +Macro +Choose the macro that you want to execute when the selected graphic, frame, or OLE object is selected. Depending on the object that is selected, the function is either found on the Macro tab of the Object dialog, or in the Assign Macro dialog. +
+Event +Lists the events that are relevant to the macros that are currently assigned to the selected object. +The following table describes the macros and the events that can by linked to objects in your document: + + + +Event + + +Event trigger + + +OLE object + + +Graphics + + +Frame + + +AutoText + + +ImageMap area + + +Hyperlink + + + + +Click object + + +Object is selected. + + + + + + + + + + + + + + + + + + + +Mouse over object + + +Mouse moves over the object. + + + + + + + + + + + + + + + + + + + + + +Trigger Hyperlink + + +Hyperlink assigned to the object is clicked. + + + + + + + + + + + + + + + + + + + + +Mouse leaves object + + +Mouse moves off of the object. + + + + + + + + + + + + + + + + + + + + + +Graphics load successful + + +Graphics are loaded successfully. + + + + + + + + + + + + + + + + + +Graphics load terminated + + +Loading of graphics is stopped by the user (for example, when downloading the page). + + + + + + + + + + + + + + + + + +Graphics load faulty + + +Graphics not successfully loaded, for example, if a graphic was not found. + + + + + + + + + + + + + + + + + +Input of alpha characters + + +Text is entered from the keyboard. + + + + + + + + + + + + + + + + + +Input of non-alpha characters + + +Nonprinting characters are entered from the keyboard, for example, tabs and line breaks. + + + + + + + + + + + + + + + + + +Resize frame + + +Frame is resized with the mouse. + + + + + + + + + + + + + + + + + +Move frame + + +Frame is moved with the mouse. + + + + + + + + + + + + + + + + + +Before inserting AutoText + + +Before a text block is inserted. + + + + + + + + + + + + + + + + + +After inserting AutoText + + +After a text block is inserted. + + + + + + + + + + + + + + + +
+ +Macros +Choose the macro that you want to execute when the selected event occurs. +Frames allow you to link events to a function, so that the function can determine if it processes the event or $[officename] Writer. +Category +Lists the open $[officename] documents and applications. Click the name of the location where you want to save the macros. +Macro name +Lists the available macros. Click the macro that you want to assign to the selected object. +Assign +Assigns the selected macro to the specified event. The assigned macro's entries are set after the event. +Remove +Removes the macro that is assigned to the selected item. + +Macro selection +Select the macro that you want to assign. + +
diff --git a/helpcontent2/source/text/sbasic/shared/ErrVBA.xhp b/helpcontent2/source/text/sbasic/shared/ErrVBA.xhp new file mode 100644 index 000000000..dc1c2d802 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/ErrVBA.xhp @@ -0,0 +1,129 @@ + + + + + + Err VBA Object + /text/sbasic/shared/ErrVBA.xhp + + + +
+ + Err object + Error;raising + Error;handling + +

Err Object [VBA]

+ Use VBA Err object to raise or handle runtime errors. +
+ Err is a built-in VBA global object that allows: + + to raise predefined Basic errors + to throw user-defined exceptions + to name the routine originating the error + to describe the error and possible solutions + + + VBA Err object has the following properties and methods: +

Properties

+ + Err.Description As String + + Description property gives the nature of the error. It details the various reasons that may cause the error. Ideally, it provides the multiple course of actions to help solve the issue and prevent its reoccurrence. Its alias is Basic Error function for %PRODUCTNAME predefined errors. + + Err.Number As Long + + This the error code associated with the error. Err object default property is Number. Its alias is %PRODUCTNAME Basic Err function. + + Err.Source As String + + Source indicates the name of the routine that produces the error. Source is an option for user-defined errors. +

Methods

+ + Err.Clear() + + Resets description, Erl, number and source properties of current error. Its alias is %PRODUCTNAME Basic Resume statement. + + Err.Raise(Number As Long, Optional source As String, Optional description As String) + + Throws user-defined errors or predefined errors. Its alias is %PRODUCTNAME Basic Error statement. +

Parameters

+ Number A user-defined or predefined error code to be raised. + Error code range 0-2000 is reserved for %PRODUCTNAME Basic. User-defined errors may start from higher values in order to prevent collision with %PRODUCTNAME Basic future developments. + Source The name of the routine raising the error. A name in the form of "myLibrary.myModule.myProc" is recommended. + Description A description of the problem leading to stop the running process, accompanied with the various reasons that may cause it. A detailed list of the possible course of actions that may help solve the problem is recommended. + + + Option VBASupport 1 + + Sub ThrowErrors + Dim aDesc As String : aDesc = Space(80) + On Local Error GoTo AlertAndExecNext + Err.Raise(91, "ThrowErrors", Error(91)) + Err.Raise 2020, Description:="This is an intented user-defined error …" + Err.Raise(4096, "Standard.Module1.ThrowErrors", aDesc) + Exit Sub + AlertAndExecNext: + errTitle = "Error "& Err &" at line "& Erl &" in "& Err.Source + MsgBox Err.Description, MB_ICONEXCLAMATION, errTitle + Resume Next + End Sub + +

Exception ClassModule

+ A short ClassModule, that wraps VBA Err object, can distribute Err properties and methods for standard %PRODUCTNAME Basic modules. + + Option ClassModule + Option VBASupport 1 + + Public Property Get Description As String + Description = Err.Description + End Property + Public Property Get Number As Long + Number = Err.Number + End Property + Public Property Get Source As String + Source = Err.Source + End Property + Public Sub Clear + Err.Clear + End Sub + Public Sub Raise( number As Long, Optional Source As String, Optional Description As String) + Err.Raise number, Source, Description + End Sub + +

Example

+ + Function Exc As Object + Exc = New Exception + End Function + + Sub aRoutine + try: + On Local Error GoTo catch: + Exc.Raise(4096, "myLib.myModule.aRoutine", _ + "Any multi-line description for this user-defined exception") + ' your code goes here … + finally: + Exit Sub + catch: + errTitle = "Error "& Exc.Number &" at line "& Erl &" in "& Exc.Source + MsgBox Exc.Description, MB_ICONSTOP, errTitle + Resume finally + End Sub + + The Error statement or an Exception-like class module can be used interchangeably, while the latter adds extra features. +
+ + + +
+ +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/GetPathSeparator.xhp b/helpcontent2/source/text/sbasic/shared/GetPathSeparator.xhp new file mode 100644 index 000000000..97b22e576 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/GetPathSeparator.xhp @@ -0,0 +1,64 @@ + + + + + + GetPathSeparator function + /text/sbasic/shared/GetPathSeparator.xhp + + + + + GetPathSeparator function + +
+ GetPathSeparator Function + Returns the operating system-dependent directory separator used to specify file paths. +
+ + GetPathSeparator() + + String + + + "\" Windows + + + "/" UNIX, including MacOS + + + + + None. + + + + + + Sub ExampleGetPathSeparator + MsgBox GetPathSeparator() + End Sub + +
+ + It is recommended to use: + + + ConvertFromURL function to convert a file URL to a system file name. + + + ConvertToURL function to convert a system file name to a file URL. + + + See also URL Notation + +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/Resume.xhp b/helpcontent2/source/text/sbasic/shared/Resume.xhp new file mode 100644 index 000000000..f2f6b0d56 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/Resume.xhp @@ -0,0 +1,77 @@ + + + + + + Resume Statement + /text/sbasic/shared/Resume.xhp + + + + + Resume statement + +
+

Resume Statement

+ Resets error information and indicates what to execute next. +
+ + Resume Statement diagram + + Resume [ [0] | label | Next ] + + + 0: Resets error information and re-executes the instruction that caused the error. 0 is optional. + label: : Resets error information and resumes execution at the specified label of the current subroutine. + Next: Resets error information and executes the instruction following the one that caused the error. + Error information is built with Erl, Err and Error$ functions. + + Erl: Module line number where error occurs. + Err: Error number. + Error[$]: Error description. + + Using Resume to reset error information prevents the propagation of the handled condition to calling routines. + + +

Examples:

+ Typical error handling routines are: alerting the user, fixing the error, logging error information or re-throwing custom errors that provide explanations with resolution instructions. Use Resume label when requiring such mechanisms. + + Sub Error_Handling + try: On Error GoTo catch + ' routine code goes here + Error 91 ' example error + finally: + ' routine cleanup code goes here + Exit Sub + catch: + Print Erl, Err, Error$ + Resume finally + End Sub ' Error_Handling + + Use Resume Next, for example, when reporting anomalies encountered for an iterating process that must not be interrupted. In which case multiple handling routines may be required. + + Sub Iteration + planets = Array("☿","♀","♁","♂","♃","♄","⛢","♆") + try: + On Error GoTo ReportAndProcessNext + For ndx = -3 To 11 Step 1 + MsgBox planets(ndx) + Next + On Error GoTo 0 ' Stop error catching + finally: + Exit Sub + ReportAndProcessNext: + Print "Error "& Err &" at line "& Erl &" - "& Error$ + Resume Next + End Sub ' Iteration + + Using Resume without parameters to re-execute the faulty instruction can fit certain situations. However that may cause a neverending loop. + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/calc_functions.xhp b/helpcontent2/source/text/sbasic/shared/calc_functions.xhp new file mode 100644 index 000000000..7f0169fd7 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/calc_functions.xhp @@ -0,0 +1,865 @@ + + + + + + + Calling Calc Functions in Macros + /text/sbasic/shared/calc_functions.xhp + + + + + calling Calc function;macros + macros;calling Calc function + createUNOservice function;calling Calc function + API;addin.Analysis + +

Calling Calc Functions

+In addition to the native BASIC functions, you can call Calc functions in your macros and scripts. +

Calling Internal Calc functions in Basic

+ Use the CreateUNOService function to access the com.sun.star.sheet.FunctionAccess service. + + +

Calling Add-In Calc Functions in BASIC

+The Calc Add-In functions are in service com.sun.star.sheet.addin.Analysis. + + +REM Example calling Addin function SQRTPI +Function MySQRTPI(arg as double) as double + Dim oService as Object + oService = createUNOService("com.sun.star.sheet.addin.Analysis") + MySQRTPI = oService.getSqrtPi(arg) +End Function + + + + + + Calc Function name + + + UNO service name + + + + + ACCRINT + + + com.sun.star.sheet.addin.Analysis.getAccrint + + + + + ACCRINTM + + + com.sun.star.sheet.addin.Analysis.getAccrintm + + + + + AMORDEGRC + + + com.sun.star.sheet.addin.Analysis.getAmordegrc + + + + + AMORLINC + + + com.sun.star.sheet.addin.Analysis.getAmorlinc + + + + + BESSELI + + + com.sun.star.sheet.addin.Analysis.getBesseli + + + + + BESSELJ + + + com.sun.star.sheet.addin.Analysis.getBesselj + + + + + BESSELK + + + com.sun.star.sheet.addin.Analysis.getBesselk + + + + + BESSELY + + + com.sun.star.sheet.addin.Analysis.getBessely + + + + + BIN2DEC + + + com.sun.star.sheet.addin.Analysis.getBin2Dec + + + + + BIN2HEX + + + com.sun.star.sheet.addin.Analysis.getBin2Hex + + + + + BIN2OCT + + + com.sun.star.sheet.addin.Analysis.getBin2Oct + + + + + COMPLEX + + + com.sun.star.sheet.addin.Analysis.getComplex + + + + + CONVERT + + + com.sun.star.sheet.addin.Analysis.getConvert + + + + + COUPDAYBS + + + com.sun.star.sheet.addin.Analysis.getCoupdaybs + + + + + COUPDAYS + + + com.sun.star.sheet.addin.Analysis.getCoupdays + + + + + COUPDAYSNC + + + com.sun.star.sheet.addin.Analysis.getCoupdaysnc + + + + + COUPNCD + + + com.sun.star.sheet.addin.Analysis.getCoupncd + + + + + COUPNUM + + + com.sun.star.sheet.addin.Analysis.getCoupnum + + + + + COUPPCD + + + com.sun.star.sheet.addin.Analysis.getCouppcd + + + + + CUMIPMT + + + com.sun.star.sheet.addin.Analysis.getCumipmt + + + + + CUMPRINC + + + com.sun.star.sheet.addin.Analysis.getCumprinc + + + + + DEC2BIN + + + com.sun.star.sheet.addin.Analysis.getDec2Bin + + + + + DEC2HEX + + + com.sun.star.sheet.addin.Analysis.getDec2Hex + + + + + DEC2OCT + + + com.sun.star.sheet.addin.Analysis.getDec2Oct + + + + + DELTA + + + com.sun.star.sheet.addin.Analysis.getDelta + + + + + DISC + + + com.sun.star.sheet.addin.Analysis.getDisc + + + + + DOLLARDE + + + com.sun.star.sheet.addin.Analysis.getDollarde + + + + + DOLLARFR + + + com.sun.star.sheet.addin.Analysis.getDollarfr + + + + + DURATION + + + com.sun.star.sheet.addin.Analysis.getDuration + + + + + EDATE + + + com.sun.star.sheet.addin.Analysis.getEdate + + + + + EFFECT + + + com.sun.star.sheet.addin.Analysis.getEffect + + + + + EOMONTH + + + com.sun.star.sheet.addin.Analysis.getEomonth + + + + + ERF + + + com.sun.star.sheet.addin.Analysis.getErf + + + + + ERFC + + + com.sun.star.sheet.addin.Analysis.getErfc + + + + + FACTDOUBLE + + + com.sun.star.sheet.addin.Analysis.getFactdouble + + + + + FVSCHEDULE + + + com.sun.star.sheet.addin.Analysis.getFvschedule + + + + + GCD + + + com.sun.star.sheet.addin.Analysis.getGcd + + + + + GESTEP + + + com.sun.star.sheet.addin.Analysis.getGestep + + + + + HEX2BIN + + + com.sun.star.sheet.addin.Analysis.getHex2Bin + + + + + HEX2DEC + + + com.sun.star.sheet.addin.Analysis.getHex2Dec + + + + + HEX2OCT + + + com.sun.star.sheet.addin.Analysis.getHex2Oct + + + + + IMABS + + + com.sun.star.sheet.addin.Analysis.getImabs + + + + + IMAGINARY + + + com.sun.star.sheet.addin.Analysis.getImaginary + + + + + IMARGUMENT + + + com.sun.star.sheet.addin.Analysis.getImargument + + + + + IMCONJUGATE + + + com.sun.star.sheet.addin.Analysis.getImconjugate + + + + + IMCOS + + + com.sun.star.sheet.addin.Analysis.getImcos + + + + + IMCOSH + + + com.sun.star.sheet.addin.Analysis.getImcosh + + + + + IMCOT + + + com.sun.star.sheet.addin.Analysis.getImcot + + + + + IMCSC + + + com.sun.star.sheet.addin.Analysis.getImcsc + + + + + IMCSCH + + + com.sun.star.sheet.addin.Analysis.getImcsch + + + + + IMDIV + + + com.sun.star.sheet.addin.Analysis.getImdiv + + + + + IMEXP + + + com.sun.star.sheet.addin.Analysis.getImexp + + + + + IMLN + + + com.sun.star.sheet.addin.Analysis.getImln + + + + + IMLOG10 + + + com.sun.star.sheet.addin.Analysis.getImlog10 + + + + + IMLOG2 + + + com.sun.star.sheet.addin.Analysis.getImlog2 + + + + + IMPOWER + + + com.sun.star.sheet.addin.Analysis.getImpower + + + + + IMPRODUCT + + + com.sun.star.sheet.addin.Analysis.getImproduct + + + + + IMREAL + + + com.sun.star.sheet.addin.Analysis.getImreal + + + + + IMSEC + + + com.sun.star.sheet.addin.Analysis.getImsec + + + + + IMSECH + + + com.sun.star.sheet.addin.Analysis.getImsech + + + + + Imsin + + + com.sun.star.sheet.addin.Analysis.getImsin + + + + + IMSINH + + + com.sun.star.sheet.addin.Analysis.getImsinh + + + + + IMSQRT + + + com.sun.star.sheet.addin.Analysis.getImsqrt + + + + + IMSUB + + + com.sun.star.sheet.addin.Analysis.getImsub + + + + + IMSUM + + + com.sun.star.sheet.addin.Analysis.getImsum + + + + + IMTAN + + + com.sun.star.sheet.addin.Analysis.getImtan + + + + + INTRATE + + + com.sun.star.sheet.addin.Analysis.getIntrate + + + + + ISEVEN + + + com.sun.star.sheet.addin.Analysis.getIseven + + + + + ISODD + + + com.sun.star.sheet.addin.Analysis.getIsodd + + + + + LCM + + + com.sun.star.sheet.addin.Analysis.getLcm + + + + + MDURATION + + + com.sun.star.sheet.addin.Analysis.getMduration + + + + + MROUND + + + com.sun.star.sheet.addin.Analysis.getMround + + + + + MULTINOMIAL + + + com.sun.star.sheet.addin.Analysis.getMultinomial + + + + + NETWORKDAYS + + + com.sun.star.sheet.addin.Analysis.getNetworkdays + + + + + NOMINAL + + + com.sun.star.sheet.addin.Analysis.getNominal + + + + + OCT2BIN + + + com.sun.star.sheet.addin.Analysis.getOct2Bin + + + + + OCT2DEC + + + com.sun.star.sheet.addin.Analysis.getOct2Dec + + + + + OCT2HEX + + + com.sun.star.sheet.addin.Analysis.getOct2Hex + + + + + ODDFPRICE + + + com.sun.star.sheet.addin.Analysis.getOddfprice + + + + + ODDFYIELD + + + com.sun.star.sheet.addin.Analysis.getOddfyield + + + + + ODDLPRICE + + + com.sun.star.sheet.addin.Analysis.getOddlprice + + + + + ODDLYIELD + + + com.sun.star.sheet.addin.Analysis.getOddlyield + + + + + PRICE + + + com.sun.star.sheet.addin.Analysis.getPrice + + + + + PRICEDISC + + + com.sun.star.sheet.addin.Analysis.getPricedisc + + + + + PRICEMAT + + + com.sun.star.sheet.addin.Analysis.getPricemat + + + + + QUOTIENT + + + com.sun.star.sheet.addin.Analysis.getQuotient + + + + + RANDBETWEEN + + + com.sun.star.sheet.addin.Analysis.getRandbetween + + + + + RECEIVED + + + com.sun.star.sheet.addin.Analysis.getReceived + + + + + SERIESSUM + + + com.sun.star.sheet.addin.Analysis.getSeriessum + + + + + SQRTPI + + + com.sun.star.sheet.addin.Analysis.getSqrtpi + + + + + TBILLEQ + + + com.sun.star.sheet.addin.Analysis.getTbilleq + + + + + TBILLPRICE + + + com.sun.star.sheet.addin.Analysis.getTbillprice + + + + + TBILLYIELD + + + com.sun.star.sheet.addin.Analysis.getTbillyield + + + + + WEEKNUM + + + com.sun.star.sheet.addin.Analysis.getWeeknum + + + + + WORKDAY + + + com.sun.star.sheet.addin.Analysis.getWorkday + + + + + XIRR + + + com.sun.star.sheet.addin.Analysis.getXirr + + + + + XNPV + + + com.sun.star.sheet.addin.Analysis.getXnpv + + + + + YEARFRAC + + + com.sun.star.sheet.addin.Analysis.getYearfrac + + + + + YIELD + + + com.sun.star.sheet.addin.Analysis.getYield + + + + + YIELDDISC + + + com.sun.star.sheet.addin.Analysis.getYielddisc + + + + + YIELDMAT + + + com.sun.star.sheet.addin.Analysis.getYieldmat + + +
+
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/classmodule.xhp b/helpcontent2/source/text/sbasic/shared/classmodule.xhp new file mode 100644 index 000000000..13d95b9cb --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/classmodule.xhp @@ -0,0 +1,63 @@ + + + + + + Option ClassModule + /text/sbasic/shared/classmodule.xhp + + + + + Option ClassModule + + +
+

Option ClassModule Statement

+ Specifies that the module is a class module that contains members, properties, procedures and functions. +
+ + + This statement must be used jointly with Option Compatible statement or Option VBASupport 1, the former is enabling VBA compatibility mode, while the latter is enforcing VBA support on top of compatibility. + + Option ClassModule + + + Option Compatible + Option ClassModule + + ' Optional members go here + + Private Sub Class_Initialize() + ' Optional construction code goes here + End Sub ' Constructor + Private Sub Class_Terminate() + ' Optional destruction code goes here + End Sub ' Destructor + + ' Properties go here. + + ' Procedures & functions go here. + + +
+ + Refer to Identifying the Operating System and Getting Session Information for class module simple examples. + + + Multiple thorough class examples are available from Access2Base shared Basic library. + + + + + +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/code-stubs.xhp b/helpcontent2/source/text/sbasic/shared/code-stubs.xhp new file mode 100644 index 000000000..5425a87b5 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/code-stubs.xhp @@ -0,0 +1,58 @@ + + + + + + + BasicCodeStubs + /text/sbasic/shared/code-stubs.xhp + + + + +
+ + Dim aPicker As com.sun.star.ui.dialogs.XFilePicker + +
+
+ + aPicker.getDisplayDirectory() + +
+
+ + Dim intVar as Integer + +
+
+ + Sub Some_Calc_UNO_Types + REM A spreadsheet object + Dim oSheet As com.sun.star.sheet.XSpreadsheet + oSheet = ThisComponent.getSheets().getByIndex(0) + REM A cell object + Dim oCell As com.sun.star.table.XCell + oCell = oSheet.getCellByPosition(0,0) + End Sub + +
+ + +
\ No newline at end of file diff --git a/helpcontent2/source/text/sbasic/shared/compatibilitymode.xhp b/helpcontent2/source/text/sbasic/shared/compatibilitymode.xhp new file mode 100644 index 000000000..6340361b9 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/compatibilitymode.xhp @@ -0,0 +1,76 @@ + + + + + + CompatibilityMode function + /text/sbasic/shared/compatibilitymode.xhp + + + + + CompatibilityMode + VBA compatibility mode + +
+

CompatibilityMode() Function

+ CompatibilityMode() function is controlling runtime mode and affects all code executed after setting or resetting the mode. +
+ Use this feature with caution, limit it to document conversion for example. + Option Compatible turns on VBA compatibility at module level for the %PRODUCTNAME Basic interpreter. + This function may affect or help in the following situations: + + Creating enumerations with Enum statement + Running RmDir command in VBA mode. In VBA only empty directories are removed by RmDir while %PRODUCTNAME Basic removes a directory recursively. + Changing behaviour of Basic Dir command. The directory flag (16) for the Dir command means that only directories are returned in %PRODUCTNAME Basic, while in VBA normal files and directories are returned. + + CompatibilityMode() function may be necessary when resorting to Option Compatible or Option VBASupport compiler modes. + + CompatibilityMode(True | False) + + Given a NOT empty directory at file:///home/me/Test + + Sub RemoveDir + CompatibilityMode( true ) + RmDir( "file:///home/me/Test" ) + End Sub + + With CompatibilityMode( true ) the program results in an error, otherwise the Test directory and all its content is deleted. + + Modifying Dir behavior + + Sub VBADirCommand + CompatibilityMode( true ) ' Shows also normal files + Entry$ = Dir( "file:///home/me/Tmp/*.*", 16 ) + Total$ = "" + While Entry$ <> "" + Total$ = Total$ + Entry$ + Chr$(13) + Entry$ = Dir + Wend + MsgBox Total$ + End Sub + + +
+ + + Refer to Identifying the Operating System and Getting Session Information for Option Compatible simple examples, or Access2Base shared Basic library for other class examples making use of Option Compatible compiler mode. + + + + Variables scope modification in Using Procedures and Functions with CompatibilityMode() function. + + + + + +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/compatible.xhp b/helpcontent2/source/text/sbasic/shared/compatible.xhp new file mode 100644 index 000000000..b3e44cd0d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/compatible.xhp @@ -0,0 +1,66 @@ + + + + + + Option Compatible + /text/sbasic/shared/compatible.xhp + + + + + Option Compatible + VBA compatibility option + + +
+

Option Compatible Statement

+ Option Compatible turns on the VBA-compatible Basic compiler mode at the module level. +
+ + The function CompatibilityMode() controls runtime mode and affects all code executed after setting or resetting the mode. + This option may affect or assist in the following situations: + + Allow special characters as identifiers. all characters that are defined as + letter in the Latin-1 (ISO 8859-1) character set, are accepted + as part of identifiers. + Create VBA constants including non-printable characters. + Support Private/Public keywords for procedures. + Compulsory Set statement for objects. + Default values for optional parameters in procedures. + Named arguments when multiple optional parameters exist. + Preload of %PRODUCTNAME Basic libraries + + Option Compatible is required when coding class modules. + + Option Compatible + +

Special characters as identifiers

+ + Option Compatible + ' With this option the code works, otherwise it causes a compiling error + Sub Main + ä = 10 + print ä + End Sub + + Statement Option VBAsupport 1 sets Option Compatible statement automatically. +
+ + + + + + + Variables scope modification in Using Procedures and Functions with CompatibilityMode() function. + Refer to Identifying the Operating System and Getting Session Information for class module examples, or Access2Base shared Basic library for other class examples making use of Option Compatible compiler mode. +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/enum.xhp b/helpcontent2/source/text/sbasic/shared/enum.xhp new file mode 100644 index 000000000..5781585ae --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/enum.xhp @@ -0,0 +1,70 @@ + + + + + + Enum Statement + /text/sbasic/shared/enum.xhp + + + + + Enum statement + constant groups + enumerations + +
+

Enum Statement [VBA]

+ Define enumerations or non UNO constant groups. An enumeration is a value list that facilitates programming and eases code logic review. +
+ + + + Enum syntax + + + Enum list_name
+ ' Object Statement block + End Enum ' list_name +
+

Parameters:

+ Within a given enumeration, fit together values that logically relate to one another. + + + Option VBASupport 1
+ Private Enum _WindowManager + W1ND0WS = 1 ' Windows + OS2PM = 2 ' OS/2 Presentation Manager + MACINTOSH = 3 ' Macintosh + MOTIF = 4 ' Motif Window Manager / Unix-like + OPENLOOK = 5 ' Open Look / Unix-like + End Enum + Public Function WindowManager() As Object + WindowManager = _WindowManager + End Function ' <library>.<module>.WindowManager.XXX +
+ Enumerated values are rendered to Long datatype. Basic functions are public accessors to enumerations. Enumeration names and value names must be unique within a library and across modules. + +

Usage:

+ Display WindowManager grouped constant values: + + Dim winMgr As Object : winMgr = <library>.<module>.WindowManager + With winMgr + Print .MACINTOSH, .MOTIF, .OPENLOOK, .OS2PM, .W1ND0WS + End With + + Enumerations can be extended to other data types using Type statement definitions. Calling Python Scripts from Basic illustrates that mechanism. +
+ Const statement, constants + Option VBASupport statement + With statement +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/fragments.xhp b/helpcontent2/source/text/sbasic/shared/fragments.xhp new file mode 100644 index 000000000..f0ecbd388 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/fragments.xhp @@ -0,0 +1,70 @@ + + + + + + Basic syntax diagrams fragments + /text/sbasic/shared/fragments.xhp + + + +
+

Syntax fragments

+ %PRODUCTNAME Basic syntax fragments. +
+ +
+

argument fragment

+ argument fragment + + {[Optional [ByRef|ByVal]]|ParamArray} argument {{As typename|char}[ = expression]|[()]As Variant} + +

Parameters

+ Optional: The argument is not mandatory. + ByRef: The argument is passed by reference. ByRef is the default. + ByVal: The argument is passed by value. Its value can be modified by the called routine. + char: Type declaration character. + typename: Primitive data type name. Library or module defined types can also be specified. + = expression: Specify a default value for the argument, matching its declared type. Optional is necessary for each argument specifying a default value. + ParamArray: Use ParamArray when the number of parameters is undetermined. A typical scenario is that of a Calc user-defined function. Using ParamArray should be limited to the last argument of a routine. + UsingParamArray or = expression require Option Compatible to be placed before the executable program code in a module. + When using Option VBASupport 1, Optional arguments with no default value (= expression) are initialized according to their data type, except if Variant. +
+ +
+

array fragment

+ array fragment + + ( [[start To] end], .. ) + +

Parameters

+ start: Lower bound of a dimension. + end: Upper bound of a dimension. + Multiple dimensions for an array are denoted using comma (,) sign. +
+ +
+

typename fragment

+ primitive data types fragment + + {Boolean|Byte|Currency|Date|Double|Integer|Long|Object|Single|String|Variant} + +
+ +
+

char fragment

+ type declaration characters + + { % | & | ! | # | $ | @ } + +
+ + +
diff --git a/helpcontent2/source/text/sbasic/shared/keys.xhp b/helpcontent2/source/text/sbasic/shared/keys.xhp new file mode 100644 index 000000000..5dfef6e6c --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/keys.xhp @@ -0,0 +1,110 @@ + + + + + + + + +Keyboard Shortcuts in the Basic IDE +/text/sbasic/shared/keys.xhp + + +Sun Microsystems, Inc. + + + +
+keyboard;in IDE +shortcut keys;Basic IDE +IDE;keyboard shortcuts + +Keyboard Shortcuts in the Basic IDE +
+In the Basic IDE you can use the following keyboard shortcuts: + + + +Action + + +Keyboard shortcut + + + + +Run code starting from the first line, or from the current breakpoint, if the program stopped there before. + + +F5 + + + + +Stop + + +Shift+F5 + + + + +Add watch for the variable at the cursor. + + +F7 + + + + +Single step through each statement, starting at the first line or at that statement where the program execution stopped before. + + +F8 + + + + +Single step as with F8, but a function call is considered to be only one statement. + + +Shift+F8 + + + + +Set or remove a breakpoint at the current line or all breakpoints in the current selection. + + +F9 + + + + +Enable/disable the breakpoint at the current line or all breakpoints in the current selection. + + +Shift+F9 + + +
+ +A running macro can be aborted with Shift+CommandCtrl+Q, also from outside of the Basic IDE. If you are inside the Basic IDE and the macro halts at a breakpoint, Shift+CommandCtrl+Q stops execution of the macro, but you can recognize this only after the next F5, F8, or Shift+F8. + +
diff --git a/helpcontent2/source/text/sbasic/shared/main0211.xhp b/helpcontent2/source/text/sbasic/shared/main0211.xhp new file mode 100644 index 000000000..ab262d685 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/main0211.xhp @@ -0,0 +1,76 @@ + + + + + + + + +Macro Toolbar +/text/sbasic/shared/main0211.xhp + + +Sun Microsystems, Inc. + + + + + +
+ toolbars; Basic IDEmacro toolbarMacro Toolbar + The Macro Toolbar contains commands to create, edit, and run macros. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/main0601.xhp b/helpcontent2/source/text/sbasic/shared/main0601.xhp new file mode 100644 index 000000000..19bf5c3c1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/main0601.xhp @@ -0,0 +1,71 @@ + + + + + + + $[officename] Basic Help + /text/sbasic/shared/main0601.xhp + + + + + + + +

%PRODUCTNAME Basic Help

+ +
+%PRODUCTNAME provides an Application Programming Interface (API) that allows controlling the $[officename] components with different programming languages by using the $[officename] Software Development Kit (SDK). For more information about the $[officename] API and the Software Development Kit, visit https://api.libreoffice.org +This help section explains the most common functions of %PRODUCTNAME Basic. For more in-depth information please refer to the OpenOffice.org BASIC Programming Guide on the Wiki. +
+ +Working with %PRODUCTNAME Basic + + + + + + + + + + +Working with VBA Macros + + + +

Working with Macros in Python

+ + + +%PRODUCTNAME internal Basic macro libraries +%PRODUCTNAME installs a set of Basic macro libraries that can be accessed from your Basic macros. + + + + + + + + + + + +
diff --git a/helpcontent2/source/text/sbasic/shared/partition.xhp b/helpcontent2/source/text/sbasic/shared/partition.xhp new file mode 100644 index 000000000..09e42f54e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/partition.xhp @@ -0,0 +1,60 @@ + + + + + + + Partition Function + /text/sbasic/shared/partition.xhp + + + +
+ + Partition Function + +

Partition Function [VBA]

+ Returns a string indicating where a number occurs within a calculated series of ranges. +
+ + + Partition( Number, Start, End, Interval) + + String + + + Number: Required. The number to determine the partition. + Start: Required. An integer number defining the lower value of the range of numbers. + End: Required. An integer number defining the highest value of the range. + Interval: Required. An integer number that specifies the size of the partitions within the range of numbers (between Start and End). + + + + Option VBASupport 1 + Option Explicit + Sub Test_Partition + Dim retStr As String + retStr = Partition(20, 0, 98, 5) + print "20:24 the number 20 occurs in the range: " & retStr + retStr = Partition(20, 0, 99, 1) + print " 20: 20 the number 20 occurs in the range: " & retStr + retStr = Partition(120, 0, 99, 5) + print "100: the number 120 occurs in the range: " & retStr + retStr = Partition(-5, 0, 99, 5) + print " : -1 the number -5 occurs in the range: " & retStr + retStr = Partition(2, 0, 5, 2) + print " 2: 3 the number 2 occurs in the range: " & retStr + End Sub + +
+ +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/property.xhp b/helpcontent2/source/text/sbasic/shared/property.xhp new file mode 100644 index 000000000..31a489715 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/property.xhp @@ -0,0 +1,126 @@ + + + + + + Property Statement + /text/sbasic/shared/property.xhp + + + + + Property statement + + +

Property Statement

+ A property, also called field or attribute, characterizes a given object or piece of information. Properties can be used to control access to data. It is common use to include instructions at setting or reading time of properties. Code can vary from simple assignment to complex context dependant routines. Using Get, Let or Set accessers enforces properties' consistency when necessary. + This statement requires Option Compatible to be placed before the executable program code in a module. + + + + Property Get Statement diagram + + + [Private | Public] Property Get name[char | As typename] + End Property + + + + Property Set Statement diagram + + + [Private | Public] Property [Let | Set] name[char] [([Optional [ByRef | ByVal]]value[char | As typename])] [As typename] + End Property + + + + name: The property name. + + argument: Value to be passed to the Property setter routine. + Property setters often use a single argument. Multiple arguments are equally accepted. + + + + + +

Examples

+ + Option Compatible + Sub Main + ProductName = "Office" + Print ProductName ' displays "%PRODUCTNAME" + End Sub + + Private _office As String + Property Get ProductName As String + ProductName = _office + End Property + Property Let ProductName(value As String) + _office = "Libre"& value + End Property + + In the absence of Property Let or Property Set, Property Get helps define protected information, which can not be accidently altered by a foreign module: + + Option Compatible + Public Property Get PathDelimiter As String ' Read-only variable + Static this As String + If this = "" Then : Select Case GetGuiType() + Case 1 : this = ";" ' Windows + Case 4 : this = ":" ' Linux or macOS + Case Else : Error 423 ' Property or method not defined: PathDelimiter + End Select : End If + PathDelimiter = this + End Property ' read-only PathDelimiter + + Sub Main + PathDelimiter = "a sentence" ' does nothing + End Sub + + Use Let or Set when handling UNO services or class objects: + + Option Compatible + Sub Main + 'Set anObject = CreateUnoService( "com.sun.star.frame.Desktop" ) + anObject = CreateUnoService( "com.sun.star.frame.Desktop" ) + Print anObject.SupportedServiceNames(0) ' displays "com.sun.star.frame.Frame" + End Sub + + Property Get anObject As Object + Set anObject = _obj + End Property + + Private _obj As Object + + 'Property Set anObject(value As Object) + 'Set _obj = value.CurrentFrame + 'End Property + Property Let anObject(value As Object) + Set _obj = value.CurrentFrame + End Property + +
+ End, Exit statements + + Using Procedures and Functions + + + +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/replace.xhp b/helpcontent2/source/text/sbasic/shared/replace.xhp new file mode 100644 index 000000000..7f4e825f1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/replace.xhp @@ -0,0 +1,54 @@ + + + + + + + Replace Function + /text/sbasic/shared/replace.xhp + + + +
+ + Replace function + +

Replace Function

+ Replaces some string by another. +
+ + + Replace (Text As String, SearchStr As String, ReplStr As String [, Start As Long [, Count as Long [, Compare As Boolean]]] + + + String + + + Text: Any string expression that you want to modify. + SearchStr: Any string expression that shall be searched for. + ReplStr: Any string expression that shall replace the found search string. + Start: Numeric expression that indicates the character position where the search starts and also the start of the substring to be returned. + Count: The maximal number of times the replace shall be performed. + Compare: Optional boolean expression that defines the type of comparison. The value of this parameter can be TRUE or FALSE. The default value of TRUE specifies a text comparison that is not case-sensitive. The value of FALSE specifies a binary comparison that is case-sensitive. You can as well use 0 instead of FALSE or 1 instead of TRUE. + + + + + + + msgbox replace ("aBbcnnbnn", "b", "$", 1, 1, FALSE) 'returns "aB$cnnbnn" + REM meaning: "b" should be replaced, but + REM * only when lowercase (parameter 6), hence second occurrence of "b" + REM * only first (respecting case) occurrence (parameter 5) + msgbox replace ("ABCDEFGHI", "E", "*", 4) + REM returns D*FGHI because the search starts at position 4, which is also the start of the returned string. + + +
diff --git a/helpcontent2/source/text/sbasic/shared/special_vba_func.xhp b/helpcontent2/source/text/sbasic/shared/special_vba_func.xhp new file mode 100644 index 000000000..32d98942e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/special_vba_func.xhp @@ -0,0 +1,127 @@ + + + + + + + Exclusive VBA functions + /text/sbasic/shared/special_vba_func.xhp + + + + + + +
+ + VBA Functions;Introduction + + + +Exclusive VBA Functions and Statements +%PRODUCTNAME Basic adds this set of functions when VBA support is enabled. +
+These exclusive VBA functions are enabled when the statement Option VBASupport 1 is placed before the first macro of a %PRODUCTNAME Basic module. + +
+ + VBA Statements + +

VBA Statements

+ + + +
+ +
+ + VBA Functions;Text Functions + +Text functions + + + + +
+ +
+ + VBA Functions;Financial Functions + +Financial functions + + + + + + + + + + + + + +
+ +
+ + VBA Functions;Date and Time Functions + +Date and time functions + + + +
+ +
+ + VBA Functions;I/O Functions + + +I/O Functions + +
+ +
+ + VBA Functions;Mathematical Functions + VBA Functions;formatting numbers + VBA Functions;partitioning numbers + + +Mathematical Functions + + + + +
+ +
+ + + VBA Functions;Object Properties and Methods + + +Object Properties and Methods + + +
+ +
diff --git a/helpcontent2/source/text/sbasic/shared/stardesktop.xhp b/helpcontent2/source/text/sbasic/shared/stardesktop.xhp new file mode 100644 index 000000000..fec1efd76 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/stardesktop.xhp @@ -0,0 +1,38 @@ + + + + + + StarDesktop object + /text/sbasic/shared/stardesktop.xhp + + + + +
+ + StarDesktop + API; Desktop + + +

StarDesktop object

+ The StarDesktop object represents %PRODUCTNAME application. Some routines or user interface objects such as current window can be used via StarDesktop. +
+

Example:

+ + Dim docURL As String + Dim doc As Object, docProperties() + docURL = ConvertToURL("C:\My Documents\example.odt") + Rem com.sun.star.frame.Desktop + doc = StarDesktop.LoadComponentFromURL(docURL, "_blank", 0, docProperties) + + +
+ diff --git a/helpcontent2/source/text/sbasic/shared/uno_objects.xhp b/helpcontent2/source/text/sbasic/shared/uno_objects.xhp new file mode 100644 index 000000000..6d8ae8d6a --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/uno_objects.xhp @@ -0,0 +1,46 @@ + + + + + + UNO Objects + /text/sbasic/shared/uno_objects.xhp + + + + + programming;UNO objects + UNO objects + UNO functions + +
+

UNO Objects, Functions and Services

+ Functions, objects and services of Unified Network Objects (UNO). +
+

BasicLibraries Object

+ + + + + + + + +

DialogLibraries Object

+ + + + + + + + %PRODUCTNAME provides an Application Programming Interface (API) that allows controlling the $[officename] components with different programming languages by using the $[officename] Software Development Kit (SDK). For more information about the $[officename] API and the Software Development Kit, visit https://api.libreoffice.org + +
diff --git a/helpcontent2/source/text/sbasic/shared/vbasupport.xhp b/helpcontent2/source/text/sbasic/shared/vbasupport.xhp new file mode 100644 index 000000000..e07bc4817 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/vbasupport.xhp @@ -0,0 +1,54 @@ + + + + + + + Support for VBA Macros + /text/sbasic/shared/vbasupport.xhp + + + + + + +
+Working with VBA Macros +Visual Basic for Applications (VBA) is an implementation of Microsoft's Visual Basic which is built into all Microsoft Office applications. +
+Support for VBA is not complete, but it covers a large portion of the common usage patterns. Most macros use a manageable subset of objects in the Excel API (such as the Range, Worksheet, Workbook, etc.) and the support include those objects, and the most commonly used method/properties of those objects. + +Loading Microsoft Office documents with executable VBA macros +Choose %PRODUCTNAME - PreferencesTools - Options - Load/Save - VBA Properties and mark the Executable code checkbox. Then load or open your document. + + +Running VBA Macros +Run VBA macros in the same way as %PRODUCTNAME Basic macros. +Since support for VBA is not complete, you may have to edit the VBA code and complete the missing support with %PRODUCTNAME Basic objects, statements and functions. + +Editing VBA Macros +VBA macros can be edited in the %PRODUCTNAME Basic IDE. + +
+VBA Properties +%PRODUCTNAME Basic IDE +
+ + +
-- cgit v1.2.3