You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
While developing Swate the need for clipboard support arose. I decided to parse the cells to tab seperated strings, due to:
Excel support. Pasting tab separated strings into Excels makes automatic cell splits.
The existing CompositeCell.GetContent() function returns all fields as string array and build a good basis for this function
Describe the solution you'd like
⚠️ Function names are off, there must be ebtter options.
letinternaltryFromContent' (content:string [])=match content with|[|freetext|]-> CompositeCell.createFreeText freetext |> Ok
|[|name; tsr; tan|]-> CompositeCell.createTermFromString(name, tsr, tan)|> Ok
|[|value; name; tsr; tan|]-> CompositeCell.createUnitizedFromString(value, name, tsr, tan)|> Ok
| anyElse -> sprintf "Unable to convert \"%A\" to CompositeCell." anyElse |> Error
typeCompositeCellwithstatic membertryFromContent(content:string [])=match tryFromContent' content with| Ok r -> Some r
| Error _-> None
static memberfromContent(content:string [])=match tryFromContent' content with| Ok r -> r
| Error msg -> raise (exn msg)memberthis.ToTabStr()= this.GetContent()|> String.concat "\t"static memberfromTabStr(str:string)=letcontent= str.Split('\t',enum<System.StringSplitOptions>3)
CompositeCell.fromContent content
static memberToTabTxt(cells:CompositeCell [])=
cells
|> Array.map (fun c -> c.ToTabStr())|> String.concat (System.Environment.NewLine)static memberfromTabTxt(tabTxt:string)=letlines= tabTxt.Split(System.Environment.NewLine,enum<System.StringSplitOptions>3)letcells= lines |> Array.map (fun line -> CompositeCell.fromTabStr line)
cells
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
While developing Swate the need for clipboard support arose. I decided to parse the cells to tab seperated strings, due to:
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: