---------------------------------------------------------------------- --- Knud van Eeden --- 30 August 2008 - 08:44 pm --------------------- Computer: Editor: Text: TSE: Template: Expansion: Intellisense: Operation: Create: How to [word expansion / abbreviation] --- -Possible ways to save typing, and minimizing time to create your programs in the different computer languages: 1. Use abbreviations. E.g. in TSE --- cut here: begin --------------------------------------------------GetProfileString--- cut here: end ---------------------------------------------------- is abbreviated to --- cut here: begin --------------------------------------------------G.--- cut here: end ---------------------------------------------------- E.g. --- cut here: begin --------------------------------------------------PushPosition()--- cut here: end ---------------------------------------------------- is abbreviated to --- cut here: begin --------------------------------------------------p.--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------PopPosition()--- cut here: end ---------------------------------------------------- is abbreviated to --- cut here: begin --------------------------------------------------po.--- cut here: end ---------------------------------------------------- ... That saves already a lot of typing. -The most frequently used computer language keywords get the shortest abbreviation (Hoffman principle). This optimization principle was e.g. used to create the '-.' notation in Morse. The most used combinations got the shortest notation, rarely used combinations a much longer notation. Hoffman used it to create optimal file compression. The most frequent occurring words got the shortest compression code. Here you can use it to type less, because if your most typed keywords have the shortest abbreviation, in all you will type less characters. --- You are not obliged to use a dot '.' of course, because it means typing another extra character each time. --- But you could reserve e.g. the dot '.' for keywords only in that computer language in your templates. --- Create e.g. tables for 'keyword versus its abbreviation' by putting e.g. the synhi keywords in a table, then run a macro through this table to create the necessary entries in the template.s macro. --- cut here: begin --------------------------------------------------GetProfileString g. PushPostion p. PopPosition po. ...--- cut here: end ---------------------------------------------------- and so on for other keywords in that computer language --- 2. Use intellisense 3. Use word expansion by checking for other already existing words around the word charcters you currently are typing, in the current file. --- Ad 3. About 'Intellisense': Typically computer languages using dot notation (Java, JavaScript, Ruby, Delphi, ...) use this 'intellisense' feature. === You find it e.g. built-in or implemented in --- cut here: begin ---------------------------------------------------Borland CodeGear IDEs (Delphi, PHP, ...), -Microsoft Visual Studio, -Komodo, ... -...--- cut here: end ---------------------------------------------------- --- To build one of the simplest systems possible: My idea was to work with tables. -1 table for each language. -Thus a table with one or more rows, with in each row a keyword. -Each column corresponds with a next dot option for that keyword. E.g. dot 1 opens column 1 dot 2 opens column 2 When the user is typing the keyword, you count for the number of the dot in what is typed until now. And open the corresponding column for that keyword in a LIST(). You extract the column (e.g. by searching for '|' and '--------' in that table for that language) and put this in a temporary buffer. then you show that buffer using List. --- E.g. the user types the keyword, followed by a dot: first. 1. You macro sees the first dot '.', 2. Searches if it finds the keyword in the first column in the rows of the table. 3. if yes, it counts the dot '.' 4. It is the 1st dot. 5. Thus it puts column2 of that table in a temporary buffer 6. Using List show that buffer content with the options to the user 7. If the user chooses and presses ENTER, then insert that content of that column2 at that position in the text. 8. Continues this steps for more dots. === 1. Thus e.g. if you have to type first.second.third.fourth or anotherfirst.anothersecond.anotherthird.anotherfourth 2. You put it in a table --- cut here: begin --------------------------------------------------ComputerLanguage1 -------------------------------------------------------------------------------- | column1 | column2 | column3 | column4 | -------------------------------------------------------------------------------- first second third fourth anotherfirst anothersecond anotherthird anotherfourth ... ... ... ----------------------------------------------------------------------------------- cut here: end ---------------------------------------------------- and do similar for other computer languages. Each language gets such a table, with different keywords. --- cut here: begin --------------------------------------------------ComputerLanguage2 -------------------------------------------------------------------------------- | column1 | column2 | column3 | column4 | -------------------------------------------------------------------------------- first1 second1 third1 fourth1 anotherfirst1 anothersecond1 anotherthird1 anotherfourth1 ... ... ... ... ----------------------------------------------------------------------------------- cut here: end ---------------------------------------------------- and so on... for computer language3, 4, 5, ..., N === E.g. When typing --- cut here: begin --------------------------------------------------Test1.test2.test3.test4--- cut here: end ---------------------------------------------------- It should show column1 options at first dot --- cut here: begin --------------------------------------------------option11 option12 option13 ...--- cut here: end ---------------------------------------------------- It should show column2 options at second dot --- cut here: begin --------------------------------------------------option21 option22 option23 ...--- cut here: end ---------------------------------------------------- It should show column3 options at third dot --- cut here: begin --------------------------------------------------option31 option32 option33 ...--- cut here: end ---------------------------------------------------- and so on... === Steps: Overview: 1. -For each computer language with keywords you want to expand 2. -Create a table with N columns --- cut here: begin ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- DATABASE: DATABASENAME: <DATABASENAME> --------------------------------------------------------------------------------------------------------------------------------------------------- TABLE: TABLENAME: <TABLENAME> --------------------------------------------------------------------------------------------------------------------------------------------------- TABLE: TYPE: ONE TO MANY --------------------------------------------------------------------------------------------------------------------------------------------------- | NR | KEYWORD | DOT1 | DOT2 | DOT3 ... | DOT | --------------------------------------------------------------------------------------------------------------------------------------------------- INTEGER( 4 ) NN STRING( 40 ) NN STRING( 40 ) NN STRING( 40 ) NN STRING( 40 ) NN ... STRING( 40 ) NN --------------------------------------------------------------------------------------------------------------------------------------------------- 01 keyword1 expansiondot11 expansiondot12 expansiondot13 ... expansiondot1Last 02 keyword2 expansiondot21 expansiondot22 expansiondot23 ... expansiondot2Last 03 keyword3 expansiondot31 expansiondot32 expansiondot33 ... expansiondot3Last ... Last keywordLast expansiondotLast1 expansiondotLast2 expansiondotLast3 ... expansiondotLastLast ------------------------------------------------------------------------------------------------------------------------------------------------------ cut here: end ---------------------------------------------------- 2. -Each column is a further expansion 1. -If current character is dot 1 1. -Shows options for column dot1 in a list 2. -If current character is dot 2 1. -Shows options for column dot2 in a list 3. -and so on... 3. -The table is loaded once in N list buffers (for speed purposes) 4. -This loading happens once at the event of loading the file with that extension 1. -Use e.g. Hook LoadFile 5. -When pressing a key, that option is inserted 6. -Create a table for --- cut here: begin --------------------------------------------------1. -Java 2. -TSE 3. -C++ 4. -C# 5. -JavaScript 6. -PHP 7. -Perl 8. -Ruby 9. -Python 10. -HTML 11. -and so on...--- cut here: end ---------------------------------------------------- === Book: see also: === Diagram: see also: === File: see also: === File: version: control: see also: === Help: see also: === Image: see also: === Internet: see also: === Podcast: see also: === Record: see also: === Screencast: see also: === Table: see also: E.g. example of such a possible table for computer language (TSE, JavaScript, ...) Similarly adding thus extra columns for intellisense. I have added all the computer language keyword tables drafts which I created until now, and should expand this further soon, to include intellisense. Indeed using this tables or similar data structures as your DATA source, you could use this to easily create or build from this -the syntax highlight files -abbreviations -intellisense -... === Note: This tables are in a draft state, and should be worked out soon. --- cut here: begin --------------------------------------------------<table keywords TSE> <table keywords JavaScript> ...--- cut here: end ---------------------------------------------------- === Video: see also: === <version>1.0.0.0.2</version> ----------------------------------------------------------------------
|